阻止浏览器中下拉显示出网址

加入这段代码就可以了。

 document.body.addEventListener('touchmove', function (e) {
            e.preventDefault(); //阻止默认的处理方式(阻止下拉滑动的效果)
        }, {
            passive: false
        }); //passive 参数不能省略,用来兼容ios和android

猜你喜欢

转载自blog.csdn.net/linxner/article/details/82625907