I am trying to something simple -- make a jQuery script that will wait to show the entire page, including all DIVs, text, and images. While the page is loading, instead of showi
$(document).ready(...)
fires as soon the DOM is loaded. This is too soon. You should use $(window).on('load', ...)
:
JavaScript:
$(window).on('load', function(){
$('#cover').fadeOut(1000);
})
CSS:
#cover {
background: url("to/your/ajaxloader.gif") no-repeat scroll center center #FFF;
position: absolute;
height: 100%;
width: 100%;
}
HTML:
look at this jsFiddle: http://jsfiddle.net/gK9wH/9/