Lazy Load on MULTIPLE horizontal containers

白昼怎懂夜的黑 提交于 2019-12-08 03:13:41

问题


I'm using Lazy Load jQuery plugin:

http://www.appelsiini.net/projects/lazyload

My question is:

is it possible to have multiple scrolling containers each with a lazyload images inside, like this:

$("#container1 img.lazy").lazyload({ 
container: $("#container1")});

$("#container2 img.lazy").lazyload({ 
container: $("#container2")});

When I do this it seems to only keep track of the most recently called.

I tried to call the function two times (one for each container) but it didn't work, I also tried to call both containers this way: container: $("#container1, #container2")}); and didn't work either.

I actually tried a lot of things, but I can't make this works.

Thanks a lot for reading.

来源:https://stackoverflow.com/questions/10539557/lazy-load-on-multiple-horizontal-containers

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!