在 IOS 13 safari 上禁用双指缩放 [英] Disable pinch zoom on IOS 13 safari

查看:58
本文介绍了在 IOS 13 safari 上禁用双指缩放的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我知道这个问题已经被问到了很多.但是在最新版本的 safari 上是否有任何关于禁用捏合缩放的更新?

I know this question has been asked so much. But have there been any updates on being able to disable pinch zoom on the latest version of safari?

我有一个地图应用程序,它实现了捏合以放大网页(地图)的特定元素.我希望用户能够放大地图,而页面周围的 UI 保持不变.这破坏了我在 IOS 上的用户体验.

I have a map application that implements pinch to zoom on specific elements of the webpage (the map). I want users to be able to zoom in on the map, while the UI around the page stays the same. This has destroyed my users experience on IOS.

有没有办法至少禁用捏合以放大特定元素?

Is there a way to at least disable pinch to zoom on specific elements?

这是我的网页,因此您可以清楚地看到我在说什么.我希望您能明白为什么禁用视口缩放(至少当用户捏住地图时)实际上对可访问性有益.

Here is my webpage so you can see exactly what I'm talking about. I hope you can see why disabling viewport zoom (at least when the user pinches on the map) would actually be a benefit, for accessibility.

https://www.yapms.com/app/?t=USA_2020_presidential

更多信息:我已经在使用hammerjs 来放大网页上的特定元素,所以我想在这些元素上禁用苹果视口缩放.

more info: I'm using hammerjs to zoom in on specific elements on the webpage already, so I want to disable apples viewport zoom on those elements.

推荐答案

没有对我有用的 JavaScript 解决方案.我为解决 IOS 上的问题所做的是将以下 CSS 添加到我想要阻止默认缩放操作的每个元素中.

None, of the JavaScript solutions worked for me. What I did to fix the issue on IOS was to add the following CSS to each element that I wanted to prevent the default zoom action on.

touch-action: none;

这篇关于在 IOS 13 safari 上禁用双指缩放的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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