Show loading gif of image only if it is really loading it for the first time?

I think this is the only solution for you: if you build the following into your jquery script then will work.

I think this is the only solution for you: if you build the following into your jquery script then will work. Var pic=new Image(x,y);//x,y is optional pic. Src= //path; if(pic.

Complete) donePic() else pic. Onload= donePic; If you put it inside of a timer then you'll know when it gets loaded.

– Y.G.J Mar 9 '10 at 9:34 donePic() tells you that the pic is loaded. If it enters here: if(pic. Complete) donePic(), it means that the pic is cached and it is loadaed instantly, else will be loaded.

In this else case the donePic() function will be called only when the pic has been loaded. But the first tag (the if part) can help you to determine if the pic is or not in the cache. After this is up to you.

– Ervin Mar 9 '10 at 9:51 but what it does is to to call donePic right away if it is loaded or call it after pic finish loading... that means the donePic deals with the picture... not with the loading gif. There so, I will always have the loading gif shows until finishing the check. Don't I need to do just on load and on complete to do nothing?

– Y.G. J Mar 9 '10 at 10:04 if your problem is that the loading gif appears even if the image is loaded from cache, then all you have to do is if(pic. Complete) donePic(); where donePic(); hides the loading gif. – Ervin Mar 9 '10 at 13:54 nice but a little problem with that... if I look at the page for the first time it will show me the reload and after the loop restart it will not show the reload.

If I will refresh the page - it is like I was never in the page: loading gif is there altough images are cached! Is there a solution? – Y.G. J Mar 9 '10 at 18:57.

I cant really gove you an answer,but what I can give you is a way to a solution, that is you have to find the anglde that you relate to or peaks your interest. A good paper is one that people get drawn into because it reaches them ln some way.As for me WW11 to me, I think of the holocaust and the effect it had on the survivors, their families and those who stood by and did nothing until it was too late.

Related Questions