$(‘body’).on(‘touchmove’, function (event) {event.preventDefault();});
or
document.addEventListener('touchmove', function(e){e.preventDefault()}, false);
addEventListener第三个参数默认为false,在冒泡阶段触发事件。按先捕获再冒泡来看,为何在冒泡阶段阻止滑动的默认行为,会影响到body的内部子元素的滚动。
Copyright 2014-2026 https://www.php.cn/ All Rights Reserved | php.cn | 湘ICP备2023035733号
闭关修行中......