document.addEventListener("touchmove", function(e) {
e.preventDefault();
}, {passive: false})
但是,这个方法会上下左右全部禁止,我们需要左右滑动禁止上下滑动会受到限制
我们的思路就是需要知道手指滑动的方向
上代码
document.addEventListener("touchmove", function(e) {
e.preventDefault();
}, {passive: false})
但是,这个方法会上下左右全部禁止,我们需要左右滑动禁止上下滑动会受到限制
我们的思路就是需要知道手指滑动的方向
上代码