在iOS 11.3 Safari上是否有一种防止缩放缩放的非黑客方法? [英] Is there a non-hacky way to prevent pinch zoom on iOS 11.3 Safari?

查看:154
本文介绍了在iOS 11.3 Safari上是否有一种防止缩放缩放的非黑客方法?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

确实想要禁用缩放以放大我的网页(iframe)并使用手指捏合事件进行其他自定义互动。因此,虽然Safari的文档说它支持以下条款:

I really want to disable pinch to zoom on my webpages (iframes) and use finger pinching events for another custom interaction. So while Safari per their documentation says it supports the following clause:

<meta name="viewport" content="width=device-width, user-scalable=no" />

...在实践中Safari不尊重它。

…in practice Safari doesn't honor it.

防止视口缩放的能力通常对于网络游戏体验以及围绕按钮,输入框和幻灯片输入/输出类型接口的更紧密的用户体验非常重要,甚至视频,虽然它仍然是低视力读者的良好默认。 iOS Safari上还有一个简化的阅读器模式,可提供具有所需辅助功能的整洁阅读。

The ability to prevent viewport zooming is generally important for the experience of gaming on web and for tighter user experience around buttons, input boxes and slide in/out type of interfaces, even videos, while it remaining a good default for low vision readers. There is also a stripped down reader mode on iOS Safari that provides for uncluttered reading with desired accessibility features.

恕我直言,在每个网络用例中应用针对低视力读者的可访问性原则是严苛的。可以使用被动事件监听器来修复缩放缩放,但为了卫生,问题是:是否有一种非黑客的方法呢?

IMHO, applying accessibility principle aimed at low vision readers on every usecase of web is draconian. It is possible to fix pinch zoom using passive event listeners, but for sake of hygiene, the question is: is there a non-hacky way of doing it?

最近的讨论与W3C / WCAG团队一起澄清(强调我的)可访问性指南仅指定...

In a recent discussion with W3C/WCAG team it was clarified (emphasis mine) that the accessibility guidelines specify only…


一个应该不作者一致性要求,自2016年以来一直在spec
arronei / html @ 877b59c中。这只是作者一致性
的要求,不禁止使用,但要求作者认真地考虑缩小用户的缩放能力。
apple在safari中做了什么超出了这个问题的范围,因为
不需要任何浏览器实现者。

a SHOULD NOT author conformance requirement that has been in the spec since 2016 arronei/html@877b59c. It is an author conformance requirement only, that does not forbid the use but does ask authors to consider seriously the curtailment of user's ability to zoom. What apple have done in safari is beyond the scope of this issue as it does not require anything of browser implementers.

随着iOS Safari的最新变化,Apple似乎已将可访问性指南倾向于 CAN NOT作者一致性要求,而不是出于他们所知的原因。重要的是,这里要突出显示规范和实现之间的差异。

With recent changes on iOS Safari, Apple appears to have bent the accessibility guidelines towards a CANNOT author conformance requirement instead for reasons only known to them. It is important that this difference between spec and implementation be highlighted here for the record.

与Apple iOS Safari讨论后团队在webkit上提交了一个针对此一致性问题的错误此处

Following discussions with the Apple iOS Safari team a bug was filed with webkit for this conformance issue here.

推荐答案

虽然没有非黑客的方法来阻止 pinchzoom ,是一个适用于iOS 11.3 Safari的黑客。最起码到现在。请参阅 inobounce ,在一次扫描中处理橡皮筋行为和pinchzoom。

While there isn't a non-hacky way to prevent pinchzoom, there is a hack that works on iOS 11.3 Safari still. At least for now. See inobounce that handles both rubber band behavior and pinchzoom in one sweep.

这篇关于在iOS 11.3 Safari上是否有一种防止缩放缩放的非黑客方法?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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