Вопрос

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

Это было полезно?

Решение

.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);
});
Лицензировано под: CC-BY-SA с атрибуция
Не связан с StackOverflow
scroll top