I have this code works for images loaded for the first time :
<script>
$( document ).ready(function() {
$("img.lazy").lazyload({
effect : "fadeIn",
threshold : 200
});
});
</script>
but for new images loaded from AJAX, it's not working. I read by using event delegation, it can be applied to new loaded images.
https://learn.jquery.com/events/event-delegation/
but when I tried to change my code into this :
<script>
$( document ).ready(function() {
$("img.lazy").lazyload( function(event) {
effect : "fadeIn",
threshold : 200
});
});
</script>
it makes all lazyload is not working anymore. how to attach event delegation correctly in this case? thank you.