Is there any way to show a loading image while loading a image?
-
are you talking about the same image, or show another image while one is loading?TStamper– TStamper2009-06-08 19:45:02 +00:00Commented Jun 8, 2009 at 19:45
-
Show one image while loading loading another.Peter– Peter2009-06-08 19:48:45 +00:00Commented Jun 8, 2009 at 19:48
-
so you want a "loading" picture to show until real image fully loaded?TStamper– TStamper2009-06-08 19:50:14 +00:00Commented Jun 8, 2009 at 19:50
-
yes that is exaktly what i want!Peter– Peter2009-06-08 19:56:05 +00:00Commented Jun 8, 2009 at 19:56
Add a comment
|
1 Answer
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.
2 Comments
Peter
That would not be 100% good solution as a modem user might see the image loading from top to bottom.
Matt
To overcome that, you would need to preload the image with javascript and then replace it. Theres an example here: jqueryfordesigners.com/image-loading