image loading information with jquery
Posted
by
Pradyut Bhattacharya
on Stack Overflow
See other posts from Stack Overflow
or by Pradyut Bhattacharya
Published on 2011-01-02T08:37:02Z
Indexed on
2011/01/02
8:53 UTC
Read the original article
Hit count: 336
Hi
I have a page which has a img holder with the html: -
<img src="someimage.jpeg" alt="image" class="show_image"/>
Now i m updating the image with jquery using the code...
$('.show_image').attr('src', 'anotherimage.jpeg');
Now its working fine but i want to show the users the image is being loaded and may wait
as the image size may be huge...
Is there any method in jquery to get the information of percent loaded(bytes read/remaining)
or if the image load is complete...
Also how can i place a div over the image placeholder such that the
div can fade the image(opacity:0.8) and add some text over the div as loading or something
thanks
© Stack Overflow or respective owner