Flexslider中的延迟加载 [英] Lazy Loading in Flexslider
问题描述
我正在尝试通过使用延迟加载" jQuery插件和以下内容来使 Flexslider 的延迟加载工作此网站上的说明: http://www.appelsiini.net/projects/lazyload
I am trying to get lazy loading working for Flexslider by using Lazy Loading jquery plugin and following the instructions on this site: http://www.appelsiini.net/projects/lazyload
我正在加载插件脚本,但在控制台上看不到任何错误.我尝试了没有在lazyload函数中传递容器或选项,但还是一无所获.我花了几个小时.
I am loading the plugin script and don't see any errors on console. I tried without the container or options being passed in lazyload function and still nothing. I spend hours on this.
$("img.lazy").lazyload({
effect: "fadeIn",
container: $(".slides > li")
});
有人知道如何在Flexslider中进行延迟加载吗?
Does anyone know how to get lazy loading working in Flexslider?
推荐答案
所以我将真实图像页面添加到了图像标签的data-attr属性上,并且在after
事件触发时,我会找到具有active
的图像类,并将img src属性设置为等于data-attr值.
So I added the real image page to the data-attr attribute on the image tag and on after
event fire I would find the image with active
class and set the img src attribute equal to data-attr value.
这篇关于Flexslider中的延迟加载的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!