I am trying to apply Lazy Load plugin to multiple containers. I found this similar question: Lazy Load on MULTIPLE horizontal containers.
this is my attempt: http://jsfiddle.net/BAFMC/
$(".p_outer_content").each(function() {
var tthis = $(this);
$(this).find('img').lazyload({
container: tthis
});
});
But I have the same problem as the question mentioned, which is that Lazy load only applies to the last container (.p_outer_content) (which is the third one in the fiddle).
Does anyone know how to solve this or has other suggestion? Thanks in advance'
EDIT:
Ok, I tried to reapply the lazyload function each time one of the containers is scrolled:
$(".p_outer_content").each(function() {
var tthis = $(this);
$(this).find('img').lazyload({
container: tthis
});
});
$(".p_outer_content").scroll(function() {
var tthis = $(this);
$(this).find('img').lazyload({
container: tthis
});
});
Which works, but I don't know if it a good way of solving it. Does anyone however come up with a better solution? Thanks'