Simple PageLoader
by oterox
HTML
<div class="preload"><img src="http://i.imgur.com/KUJoe.gif">
</div>
<div class="content">I would like to display a loading bar before the entire page is loaded. For now, I'm just
Note: I have tried this, but it didn't work for me:
loading bar while script runs
I also tried other solutions. In most cases, the page loads as usually or the page won't load/display at all.
Thank you for any help.</div>
CSS
.content {display:none;}
.preload { width:100px;
height: 100px;
position: fixed;
top: 50%;
left: 50%;}
JavaScript
$(function() {
$(".preload").fadeOut(2000, function() {
$(".content").fadeIn(1000);
});
});