Answer the question
In order to leave comments, you need to log in
$(document).ready in google chrome?
In chrome (17-beta, 16-stable) the onload trigger fires before the images are loaded.
If an ajax request is called from this trigger and you want to show the user a loading indicator with an animated gif twist, he will not see it, because the gif has not yet been loaded at the time the request was sent.
How to be?
Answer the question
In order to leave comments, you need to log in
Encode gif in base-64 and use data:uri in CSS - duris.ru/faq/
Isn't it easier to make this gif immediately visible? The page is loading.
It should fire before the images are loaded. Chrome has nothing to do with it, by the way.
For images there is imagesLoaded ( github.com/desandro/imagesloaded ) from under masonry.
In Chrome and Safari, in such cases, you can also use $(window).load(), which "fires" only after loading any media content.
the event fires correctly, you can write that all functions are called after the image is loaded
jQuery(function($){
var loadingImage = new Image();
loadingImage.onload = function(){
loadingImage.onload = null;
//основные функции
};
loadingImage.src = "image/loader.gif";
});
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question