I really want to disable pinch to zoom on my webpages (iframes) and use finger pinching events for another custom interaction. So while Apple in their documentation
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 fell sweep.
You can use touch-action: none
on the html, body
selector: https://developer.mozilla.org/en-US/docs/Web/CSS/touch-action#none
https://github.com/msand/InfiniDraw/commit/b96aac5f8313f56da7be6f9e9f24648ab02fc444
From How do you disable viewport zooming on Mobile Safari?
Try adding the following to your head-tag:
<meta name="viewport" content="width=device-width, initial-scale=1.0,
minimum-scale=1.0, maximum-scale=1.0, user-scalable=no">
additionally
<meta name="HandheldFriendly" content="true">
Finally, either as a style-attribute or in your css file, add the following text for webkit-based Browsers:
html {
-webkit-text-size-adjust: none
}