简体   繁体   English

控制捏缩放并将其隔离到Mobile Safari / iOS / iPad中的一个元素

[英]Controlling pinch zoom and isolating it to one element in Mobile Safari/iOS/iPad

Is there a Mobile Safari, HTML or CSS tag or property to restrict touch pinch-zooming and panning to only one element on the page? 是否有移动Safari,HTML或CSS标签或属性来限制触摸缩放和平移到页面上的一个元素? For example I want to be able to zoom in and out of an image or div element, but have various other elements on the page stay both in place and the same size. 例如,我希望能够放大和缩小图像或div元素,但页面上的各种其他元素保持原位和相同的大小。 This would probably work by restricting panning and scrolling through the viewport meta tag, and then saying I can do it but only on a specific element. 这可能通过限制平移和滚动浏览视口元标记,然后说我可以这样做但仅限于特定元素。 Any help would be greatly appreciated. 任何帮助将不胜感激。

I'm pretty sure that you would do this . 我敢肯定,你会做这个
Code: 码:
HTML: HTML:

<div class="zoom">You can zoom here!</div>
<div class="nozoom">No zooming here!</div>

CSS: CSS:

.zoom{font-size: 36px; overflow: auto; height: 100px; width: 100px; border: 1px solid black}
.nozoom{font-size: 36px; overflow: hidden; height: 100; height: 100px; width: 100px; border: 1px solid black}

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM