We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
和往常一样,给移动端页面加了禁止缩放的meta标签
<meta name="viewport" content="width=device-width,initial-scale=1.0,maximum-scale=1.0,minimum-scale=1.0,user-scalable=no">
在手机上测试一下效果。。。 完全不OK!!!meta一点作用没有 Google之后得出结论IOS10的Safari 不再识别meta viewport。。
emmmmmm。。。。
那么就只能用js来HACK了
禁用双指缩放:
document.documentElement.addEventListener('touchstart', function (event) { if (event.touches.length > 1) { event.preventDefault(); } }, false);
禁用手指双击缩放:
var lastTouchEnd = 0; document.documentElement.addEventListener('touchend', function (event) { var now = Date.now(); if (now - lastTouchEnd <= 300) { event.preventDefault(); } lastTouchEnd = now; }, false);
不过设置了viewport之后 是禁止了手指双击缩放的。所以目前最理想的方案是,viewport照常设置,js上加上禁用双指缩放的代码片段。就完全OK了。
The text was updated successfully, but these errors were encountered:
偶尔点击还会有不起作用的时候,具体原因不太清楚
Sorry, something went wrong.
还是有一丢丢瑕疵,主要是双指放大还是有bug,双指同时按在屏幕上能够避免放大,但是当手指先后放在屏幕上进行放大操作时,不能避免 ;
如果有兄嘚找到了更好的方案,请艾特一下我
No branches or pull requests
和往常一样,给移动端页面加了禁止缩放的meta标签
在手机上测试一下效果。。。
完全不OK!!!meta一点作用没有
Google之后得出结论IOS10的Safari 不再识别meta viewport。。
emmmmmm。。。。
那么就只能用js来HACK了
禁用双指缩放:
禁用手指双击缩放:
不过设置了viewport之后 是禁止了手指双击缩放的。所以目前最理想的方案是,viewport照常设置,js上加上禁用双指缩放的代码片段。就完全OK了。
The text was updated successfully, but these errors were encountered: