如果在滚动到屏幕上的某个点后尝试取消touchmove事件,则会产生错误[Intervention] Ignored attempt to cancel a touchmove event with cancelable=false, for example because scrolling is in progress and cannot be interrupted.
在这种情况下,取消正在进行的滚动正是我想要的效果。无论如何,我有什么办法可以取消touchmove事件吗?如果没有,我可以考虑一些解决方法?
我要使用以下代码取消活动:
if(scrolledTooFar) {
event.stopPropagation();
event.preventDefault();
event.returnValue = false;
return false;
}