防止iOS 11.3溢出弹跳 [英] Prevent iOS 11.3 overflow bouncing

查看:110
本文介绍了防止iOS 11.3溢出弹跳的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

从现在开始,我一直在touchmove事件上使用preventDefault技术,当我发现它似乎不适用于Safari,Chrome或Firefox的iOS 11.3上不再可用:

I've been making use of the preventDefault technique on the touchmove event since now, when I noticed it doesn't seem to work anymore on iOS 11.3, for neither Safari, nor Chrome or Firefox:

document.ontouchmove = function(event){
    event.preventDefault();
} 

iOS中现在有什么变化吗?防止在页面顶部或页面末尾跳动的方法是什么?

Has anything changed now in iOS? What's the way of preventing the bouncing at the top or end of the page?

在线复制

使用jQuery在线复制

此处的视频

推荐答案

它是由WebKit的错误引起的. 臭虫182521

It was caused by a bug of WebKit. Bug 182521

尝试

window.addEventListener("touchstart", function(event) {
  event.preventDefault();
}, {passive: false});

作为解决方法.

这篇关于防止iOS 11.3溢出弹跳的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆