首页 > swiper 不自动播放

swiper 不自动播放

多个swiper间切换,swiper-container隐藏后再显示不会触发自动播放,必须手势滑动一次,才能被触发自动播放,怎么解决,下边是配置参数
autoplay: 3000,
speed: 500,
loop: true,
observer:true,
observeParents:true,
autoplayDisableOnInteraction : false,


真是蛋疼了,我现在就想要你这种效果,点击或滑动后再开始自动播放,直接自动播放对我来说体验太差....有兴趣可以跟我交流一下


多组swiper之间的切换,用显示隐藏不自动播放的问题确实很棘手,不过可以用控制高度的方法解决,把隐藏的swiper高度设为0,overflow:hidden。需要显示的swiper高度auto;用这种方法,每个swiper是同时运转的。搞了一下午,只想到了这最笨的方法。


请问题主解决这个问题了吗


swiper.stopAutoplay();
swiper.startAutoplay();


頂一下,我也發現這個問題了。期待有人能解決。


隐藏的时候执行一下mySwiper.stopAutoplay();显示的时候执行mySwiper.startAutoplay();就可以自动播放了

【热门文章】
【热门文章】