Swiper - 无法禁用移动设备上的触摸
Swiper - Unable to disable touch on mobile
正如我所说 here,我在完全禁用较低分辨率的手势时遇到了问题。
通过将 breakpoints
与上述 "dedicated API touch options" 结合使用,例如 touchRatio, shortSwipes/longSwipes, allowTouchMove, allowSlidePrev/next
不会产生预期的结果。这是当前的实现:
swiperProject = new Swiper('.headline__container', {
direction: 'vertical',
autoplay: {
delay: 5000,
disableOnInteraction: false,
},
speed: 500,
lazy: true,
preloadImages: false,
pagination: {
el: '.swiper-pagination',
clickable: true,
},
breakpoints: {
320: {
// I tried with allowTouchMove: false, allowSlidePrev/next: false too, but nothing
touchRatio: 0,
shortSwipes: false,
longSwipes: false
},
992: {
touchRatio: 1,
shortSwipes: true,
longSwipes: true
}
}
});
基本上,我的目标是停用移动设备上的手势,以防止 body
本身的滚动阻塞 - 这些幻灯片当前设置为垂直模式。
有人知道如何实现吗?我阅读了以上关于其他问题的尝试,但它们对我没有帮助。
在此先感谢您的帮助。
现在我在移动设备上强制使用 pointer-events: none
。希望在接下来的将来,团队会尽快修复这些 API 选项。
感谢大家的关注
正如我所说 here,我在完全禁用较低分辨率的手势时遇到了问题。
通过将 breakpoints
与上述 "dedicated API touch options" 结合使用,例如 touchRatio, shortSwipes/longSwipes, allowTouchMove, allowSlidePrev/next
不会产生预期的结果。这是当前的实现:
swiperProject = new Swiper('.headline__container', {
direction: 'vertical',
autoplay: {
delay: 5000,
disableOnInteraction: false,
},
speed: 500,
lazy: true,
preloadImages: false,
pagination: {
el: '.swiper-pagination',
clickable: true,
},
breakpoints: {
320: {
// I tried with allowTouchMove: false, allowSlidePrev/next: false too, but nothing
touchRatio: 0,
shortSwipes: false,
longSwipes: false
},
992: {
touchRatio: 1,
shortSwipes: true,
longSwipes: true
}
}
});
基本上,我的目标是停用移动设备上的手势,以防止 body
本身的滚动阻塞 - 这些幻灯片当前设置为垂直模式。
有人知道如何实现吗?我阅读了以上关于其他问题的尝试,但它们对我没有帮助。
在此先感谢您的帮助。
现在我在移动设备上强制使用 pointer-events: none
。希望在接下来的将来,团队会尽快修复这些 API 选项。
感谢大家的关注