Is there a way to have a separate page loader file (such as: loader.html
) that contains only the loader.gif
image with some custom CSS, instead of having it all in the same index.html
file? I would like my index.html
file to display only after the loader.html
file is shown first. Once all the content is loaded, I want to hide the loader.html
file and reveal the content of the index.html
file.
I hope this explanation makes sense. Any help is greatly appreciated :)
Here is the code I tried:
$(window).load(function(){
if($("body").load("loader.html").fadeOut(5000)){
$("loader.html").hide();
$("index.html").show();
}
});