I have this html: <img src="myimage.jpg" id="idimg">
Is there a way with javascript to change that src to my ajax.gif until the image is fully loaded?
Please note i have already watched here: How to display a wait gif until image is fully loaded
but i don’t want that because I want my initial html to be as I wrote there (with the src of the original image) and not with a fake div container
thx
Using the same theory, you could have 2 images in the HTML source, one as the ajax.gif loader, and one as the actual image you are planning to show. Using css make sure only the loader displays on page load, and then attach an onload event to the actual image. When it is triggered you could then fade between the two.
This being said, I am not sure of the compatibility of an image onload event in IE off of the top of my head.