jquery - Multiple containers in Lazy Load -
i trying apply lazy load plugin multiple containers. found similar question: lazy load on multiple horizontal containers.
this attempt: http://jsfiddle.net/bafmc/
$(".p_outer_content").each(function() { var tthis = $(this); $(this).find('img').lazyload({ container: tthis }); });â
but have same problem question mentioned, lazy load applies last container (.p_outer_content) (which third 1 in fiddle).
does know how solve or has other suggestion? in advance'
edit:
ok, tried reapply lazyload function each time 1 of containers 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, don't know if way of solving it. come better solution? thanks'
there bug in lazyload plugin. when provide custom container, there global variable leak. have added minimum necessary fix in fork here.
https://raw.github.com/marchingants/jquery_lazyload/master/jquery.lazyload.js
here's working demo http://jsfiddle.net/bafmc/5/
i using github raw file directly in example, in project, clone file, minify , use locally.
Comments
Post a Comment