Lazy Loading in Flexslider

前端 未结 6 2042
梦如初夏
梦如初夏 2020-12-16 13:36

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/la

6条回答
  •  执念已碎
    2020-12-16 14:14

    You might as well initialize lazyload with a custom trigger event ...

    $jQ("img[data-original]").lazyload({
                effect: "fadeIn",
                skip_invisible: false,
                event: "forceLazyLoad"
            });
    

    ... and then call this event to preload all your images inside the flexslider with a call like:

    $jQ('.flex-viewport').find('img[data-original]').trigger('forceLazyLoad');
    

提交回复
热议问题