多个相同特效,无法暂停自动播放和启动
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的效果,正常。。。
页:
[1]