javascript - 在 Cordova 应用程序中捏合以缩放/缩放 iframe
<p><p>过去几天我一直在与这个问题作斗争,但无法深入了解它.. </p>
<p>我正在寻找一种将 iframe 嵌入到 cordova 应用程序(在 iOS 设备上运行)以显示外部网页并允许用户捏合以缩放/缩放 iframe 内容而不缩放主应用程序内容的方法它。 </p>
<p>cordovaView 的元数据是:</p>
<pre><code><meta name="viewport" content="initial-scale=1, user-scalable=yes">
</code></pre>
<p>我正在加载的 iframe 页面的元数据是:</p>
<pre><code><meta charset="utf-8">
</code></pre>
<p>我用来加载内容的 iframe 是这样的:</p>
<pre><code><iframe src="" zooming="true" webkitallowfullscreen mozallowfullscreen allowfullscreen width="500" height="500"></iframe>
</code></pre>
<p>在当前状态下,iframe 将与加载的网页一起显示,但它没有保持我定义的 500 X 500 大小(它强制将 iframe 调整为页面内容的大小) 并且用户可以滚动页面以查看更多 iframe 内容,但无法放大或缩小页面以供用户查看更少或更多 iframe。</p>
<p>我在 cordova 索引文件或 iframe 本身上是否缺少允许 iOS 设备捏合和缩放内容的标签?</p></p>
<br><hr><h1><strong>Best Answer-推荐答案</ strong></h1><br>
<p><p>您现在可能已经自己解决了这个问题,但它不起作用的原因是您的 iframe 文档独立于顶级 dom。在 iframe 中注册的触摸事件等不能冒泡越过它们所在的文档的障碍。</p></p>
<p style="font-size: 20px;">关于javascript - 在 Cordova 应用程序中捏合以缩放/缩放 iframe,我们在Stack Overflow上找到一个类似的问题:
<a href="https://stackoverflow.com/questions/48232156/" rel="noreferrer noopener nofollow" style="color: red;">
https://stackoverflow.com/questions/48232156/
</a>
</p>
页:
[1]