Question

I am using the script below, for my loading screen. If you can notice, it hides the loading screen before the website has finished loading.

jQuery(document).ready(function hide_preloader() { rotate = 0; $(".preloader").fadeOut(250); });

Is there something I can do to fix this, that I am obviously overlooking?

Live preview here

Thanks

Était-ce utile?

La solution

.ready fires when the dom is ready (= all elements got parsed), it doesn't mean all resources/images got loaded.

what you need is to use :

$(window).load(function() {
  // Run code
   rotate = 0;
    $(".preloader").fadeOut(250);
});
Licencié sous: CC-BY-SA avec attribution
Non affilié à StackOverflow
scroll top