i download jquery lazyload plugin from this site http://www.appelsiini.net/projects/lazyload.
from their doc i have not found that one can use any callback or not with lazyload plugin.
suppose my html look like
<div id="gallery" class="busy"><img src="blah.jpg" /></div>
<div id="gallery" class="busy"><img src="blah2.jpg" /></div>
<div id="gallery" class="busy"><img src="blah3.jpg" /></div>
my script like
$("#gallery img").lazyload();
class busy will just set a busy image at the center of div. so i need a callback and from the callback i need to detect image download completed or not if completed then i just remove the class from corresponding parent div of image tag .
so please show me the way to implement callback with lazyload and also need sample code by which i can remove the class from corresponding parent div of image tag .
thanks
I had the same question. Did some searching, came here, and found the answer. This is wat I have, and works for me:
$(this).lazyload({
effect : 'fadeIn',
load : function()
{
console.log($(this)); // Callback here
}
});
Hope this helps!
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With