You can use the following CSS
body {
visibility: hidden;
}
body.finished {
visibility: visible;
}
And from the onload handler, add the finished class to the body.
This will not work without JS. If you want this to work without JS, you can do the following, which will flicker if JS is disabled, but will remove flicker if JS is enabled.
body.not-ready{
visibility: hidden;
}
<body>
<script>
$(document.body).addClass('not-ready');
$(window).load(function(){
$(document.body).removeClass('not-ready')
});
</script>
</body>
source
share