Is there any way to show a loading image while loading a image?
A:
The easiest way would be to set a background image with css on the img element (or the containing element) - no javascript needed (you will, of course, need to set dimensions on the img tag)
If you want to ensure the image isnt displayed until fully loaded you can use this technique.
Matt
2009-06-08 19:46:32
That would not be 100% good solution as a modem user might see the image loading from top to bottom.
Petoj
2009-06-08 19:48:14
To overcome that, you would need to preload the image with javascript and then replace it. Theres an example here: http://jqueryfordesigners.com/image-loading/
Matt
2009-06-08 19:50:58