Swiper中文论坛

标题: swipe怎么实现图片预加载 求大神指教 [打印本页]

作者: zhongjinpeng    时间: 2019-1-29 16:36
标题: swipe怎么实现图片预加载 求大神指教
<div class="swiper-container">
    <div class="swiper-wrapper">
        <div class="swiper-slide">
            <img data-src="img/yhq1.png" src="img/yqh1.png" class="swiper-lazy">
            <div class="swiper-lazy-preloader"></div>
        </div>
        <div class="swiper-slide">
            <img data-src="img/yhq1.png" src="img/yqh2.png" class="swiper-lazy">
            <div class="swiper-lazy-preloader"></div>
        </div>
        <div class="swiper-slide">
            <div data-background="path/to/picture-3.jpg" class="swiper-lazy">slide3</div>
        </div>
    </div>
</div>
<script>
               
                var mySwiper = new Swiper('.swiper-container',{
    lazyLoading : true,
})

        </script>






欢迎光临 Swiper中文论坛 (http://bbs.swiper.com.cn/) Powered by Discuz! X3.2