css添加:
html, body {
overflow: hidden;
height: 100%;
}
js添加:
document.body.addEventListener('touchmove', function (e) {
e.preventDefault(); //阻止默认的处理方式(阻止下拉滑动的效果)
}, {passive: false}); //passive 参数不能省略,用来兼容ios和android
css添加:
html, body {
overflow: hidden;
height: 100%;
}
js添加:
document.body.addEventListener('touchmove', function (e) {
e.preventDefault(); //阻止默认的处理方式(阻止下拉滑动的效果)
}, {passive: false}); //passive 参数不能省略,用来兼容ios和android
本文标题:html移动端禁止页面下拉弹性滑动
本文链接:https://www.haomeiwen.com/subject/umxodctx.html
网友评论