Swiper-无法禁用移动设备上的触摸

问题描述 投票:0回答:1

正如我所说的here,在完全以较低的分辨率禁用手势时遇到了麻烦。通过将breakpoints与上述“专用API触摸选项”(例如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本身的滚动阻塞-这些幻灯片当前设置为垂直模式。

任何人都知道如何实现这一目标?我阅读了上面关于其他问题的尝试,但它们没有帮助我。

提前感谢您的帮助。

javascript swiper
1个回答
0
投票

目前,我强制pointer-events: none在移动设备上。希望团队在不久的将来能尽快修复这些API选项。

感谢大家的关注。

© www.soinside.com 2019 - 2024. All rights reserved.