Swiper中文论坛
标题:
多个相同特效,无法暂停自动播放和启动
[打印本页]
作者:
墨染锦年
时间:
2019-11-8 21:53
标题:
多个相同特效,无法暂停自动播放和启动
var picxun = new Swiper('.in_pic .swiper-container', {
loop: true,
simulateTouch: false,
slidesPerView: 2,
spaceBetween: 10,
autoplay: {
delay: 4000,
disableOnInteraction: false,
},
navigation: {
nextEl: '.pic-but .next',
prevEl: '.pic-but .prev',
}
});
//js2
$(".in_pic").mouseenter(function() {
picxun.autoplay.stop();
}).mouseleave(function() {
picxun.autoplay.start();
});
复制代码
页面中有两个
.in_pic .swiper-container。。如果不使用JS2的效果,正常。。。
欢迎光临 Swiper中文论坛 (http://bbs.swiper.com.cn/)
Powered by Discuz! X3.2