Loading image while loading image
Hi,
I'm trying to do an effect that shows a loading image while the image
is preloaded. In fact, the effect is the same than the lightbox plugin
does, but i cant understand how they are doing it.
What im trying is to do somethin like
$("img").bind(function(
originalSrc = this.src;
this.src = "images/loading.gif";
img = new Image();
img.src = originalSrc;
this.src = img.src;
)
);
Is only pseudocode. But an additional effect i wish, is that the
container has the original image size. So if, the image is 300px x
200px, the loading image would show in a container of 300px x 200px.
This has to be made dinamycally, because i would do for all images,
and i dont know this image sizes...
I think there would be somewhere explaining, but i havent found. Im
asking for a tutorial, or the way to make this.
Thanks.