iPhone 中的 iFrame
因此,我尝试在 iPhone 的 Safari 浏览器中加载一个网页。除了 iframe 之外,一切都加载得很好。理想情况下,iframe 的尺寸应为 200x200,并且我希望用户能够在其中滚动。
当我这样做时:
<iframe src="test.html" width="200" height="200"></iframe>
它似乎忽略了宽度和高度属性。
当我这样做时:
<iframe src="test.html" scrollable="no" width="200" height="200"></iframe>
然后它似乎承认了大小属性,但我无法在框架内滚动,这是我的最终目标。我也尝试过使用CSS,例如:
.iframe {
height:300px;
width:280px;
overflow:auto;
}
无济于事(显示良好,但仍然无法在iframe内内部滚动)。
非常感谢任何帮助,谢谢。
So, I've got a webpage I'm trying to load in iPhone's Safari browser. It all loads fine, except the iframe. Ideally, the iframe should be 200x200, and I'd like the user to be able to scroll around inside of it.
When I do this:
<iframe src="test.html" width="200" height="200"></iframe>
It seems to ignore the width and height attributes.
When I do this:
<iframe src="test.html" scrollable="no" width="200" height="200"></iframe>
then it seems to acknowledge the size attributes, but I can't scroll around within the frame, which is my ultimate goal. I've also tried using CSS, such as:
.iframe {
height:300px;
width:280px;
overflow:auto;
}
to no avail (displays well, but still can't scroll around inside the iframe).
Would greatly appreciate any help, thanks.
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
iframe 不像您在移动浏览器中想象的那样工作。在 iOS 上,您需要使用 2 个手指来滚动 iframe。它不像桌面浏览器上那样无缝。您可能需要重新考虑您的方法。
iframes dont work like you think in mobile browsers. On iOS you need to use 2 fingers to scroll an iframe. It's not as seamless as it is on desktop browser. You may need to rethink your approach.