Hide Elements or Page Contents until Page Loads
Hide all elements on a web page until page finishes loading using jquery. You can also display an indicator or loading gif as displayed below.
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 |
<body> <div class="loading"> <img src="indicator.gif"/> </div> <div class="content" style="display: none;"> <!-- page content goes here --> </div> </body> $(window).load(function(){ $(".loading").fadeOut("slow"); $(".content").fadeIn("slow"); }); |