滚动穿透的问题

iOS和部分安卓机 在使用了

dom.addEventListener('touchmove', function(e) {
  e.preventDefault();
}, false);

没有出现滚动穿透的问题

但是三星S6还是存在滚动穿透,请问有什么针对性的处理方法么?

阅读 1.8k
2 个回答

试试touchmove时添加 document.documentElement.style.touchAction = 'none';
touchend后 document.documentElement.style.touchAction = 'auto';

有人说加个 touch-action:none 有用,没试过 ,你可以试下

撰写回答
你尚未登录,登录后可以
  • 和开发者交流问题的细节
  • 关注并接收问题和回答的更新提醒
  • 参与内容的编辑和改进,让解决方法与时俱进
推荐问题