移动端在做左右滑动效果的时候, 已经e.preventDefault 和 e.stopPropagation 了, 但是当快速左右滑动的时候 还是会出现 滑到上一个选项卡和下一个选项卡的 现象, 请问能否阻止 这个动作刚发现只要手指点到屏幕边缘 就会触发切换标签的动作,document.body上也加preventDafult了, 仍然会触发, 如何阻止这个动作function handleStart(e) { stopDefault(e); ...}function handleMove(e) { stopDefault(e); ...}function handleEnd(e) { stopDefault(e); ...}function stopDefault(e) { e.stopPropagation(); e.preventDefault();}...document.addEventListener("touchstart", stopDefault, false)document.addEventListener("touchmove", stopDefault, false);document.addEventListener("touchend", stopDefault, false);...tab.addEventListener("touchend", handleEnd, false);tab.addEventListener("touchmove", handleMove, false);tab.addEventListener("touchstart", handleStart, false);
添加回答
举报
0/150
提交
取消