我想禁用滚动事件监听器一段时间
我在这里实现了滑块
我的代码在这里
$(window).bind('DOMMouseScroll', function (e) {
if (e.originalEvent.detail > 0) {
//scroll down
if(swiperV.activeSlide<(total-1)){
console.log('down');
swiperV.swipeNext();
console.log('down-after');
}
} else {
//scroll up
if(swiperV.activeSlide>0){
console.log('up');
swiperV.swipePrev();
console.log('up-after');
}
}
//prevent page fom scrolling
return false;
});
现在我想禁用滚动,直到幻灯片改变
当我调用 swiperV.swipeNext(); 它会改变幻灯片。