所以我喜欢4张幻灯片,在幻灯片2上我添加了一个类.no-next
所以在我从幻灯片1滑动到幻灯片2之后,我无法进入幻灯片3.
这是我使用的设置
var swiper = new Swiper('.swiper-container', {
pagination: {
el: '.swiper-pagination',
clickable: true,
},
direction: 'horizontal',
slidesPerView: 1,
spaceBetween: 1,
mousewheel: true, // i intend to change this
lazy: true,
speed: 700,
// grabCursor: true,
parallax: true,
keyboard: {
enabled: true,
},
});
swiper.on('slideChange', function () {
if($(swiper-slide).hasClass('no-next')){
mousewheel: false,
}else{
mousewheel: true,
}
});
滑动滑动后如何将鼠标滚轮设置为false 2.谢谢