如何在 iOS safari 上启用 iframe 滚动条
我正在尝试在我的网站上实现 facebook 的直播插件。我看到 PC 和 Mac 浏览器上有滚动条,但 iphone 或 ipad safari 上没有。我认为这是因为 iPhone 和 iPad 对待滚动条的方式不同,因为它们都是基于触摸的设备。所以我希望用两根手指滚动 iframe,但它也不起作用。
这是示例页面(使用不同的 src url) http://para.qacode.com/test.php< /a>
如何在 ios safari 上启用两指滚动或正常滚动条?
I am trying to implement facebook's live stream plugin on my website. I see that there is a scrollbar on pc and mac browsers, but not on iphone or ipad safari. I think it is because iphone and ipad treat scrollbar differently since they are both touch based devices. So I expect to scroll iframe with two fingers, but it does not work either.
Here is sample page (used a different src url) http://para.qacode.com/test.php
How do I enable two finger scrolling or normal scrollbar on ios safari?
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(2)
在 5 之前的 iOS 版本中,您可以使用两根手指在 iPad/iPhone 上滚动 iframe,但这是一个有点隐藏的功能,大多数人不知道它。我不确定为什么双指滚动不适用于您的 iframe - 也许有一些 JavaScript 拦截了触摸事件?
在 iOS 5 上,此问题已得到修复,并且用一根手指即可按预期使用 iframe 进行滚动。
如果您需要在 iOS 4 及更早版本上滚动页面的子区域,最好的选择是使用 iScroll 等库,它通过 JavaScript 触摸事件处理实现滚动。
On iOS versions prior to 5, you can scroll iframes on iPad/iPhone using two fingers, but this is a bit of a hidden feature and most people don't know about it. I'm not sure why tow-finger scrolling isn't working for your iframe - perhaps there is some JavaScript intercepting the touch event?
On iOS 5 this has been fixed and scrolling works as expected for iframes with one finger.
If you need to scroll a sub-region of the page on iOS 4 and earlier, the best bet is to use a library such as iScroll that implements scrolling with JavaScript touch-event handling.
将这些样式应用到父容器:
Apply these styles to the parent container: