I have an image <img id='my_img' src='img1.png'>
and a button.
Clicking the button does the following:
$('#my_img').attr('src','img2.png')
This second image (img2.png) is fairly large, and I want to know when it is fully loaded (i.e. .load() event). I tried to use .live, .bind, and .complete but none seem to fire.
Any ideas?
Thanks! Amit
I think the load event only fires once per img tag. But you can easily make a new image, and load that with a new load handler.
Once it's loaded you can set the src of the image on your page and it will pull instantly from the browser cache.
You can do this: