在 iPhone Mobile Safari 中单指滚动查看内部内容(div/iframe)
子:iPhone 移动 safari Web 应用程序
即使用户滚动,我也需要保持网页的某些部分可见。 CSS 属性position:fixed 无法按预期工作。使用溢出:自动属性或需要两指滚动,这不是我想要的。
有没有办法使用 javascript 或 iphone safari Touch API(touchMove 事件)在内部“div”或“iframes”内容上提供单指滚动?
Sub: iPhone mobile safari web application
I need to keep some parts of a web page visible even when a user scrolls. The CSS property position:fixed does not work as expected. Using the overflow:auto property on or needs two-finger scrolling which is not what I want.
Is there any way to provide single finger scrolling on the inner 'div' or 'iframes' contents using javascript or iphone safari Touch API (touchMove event)?
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(3)
在 CSS 中(适用于 iOS 5):
In CSS (for iOS 5):
本质上这是不可能的,无论是使用 div 还是 iframe,因此必须通过 javascript 监听触摸事件来解决。我正在为一个项目研究同样的问题,目前我发现了几个可以解决这个问题的 javascript 库。
我现在正在研究这个问题,但还没有做出承诺。
http://cubiq.org/iscroll-4
Three20 名人 Joe Hewitt 最近开始开发解决方案这也是如此,但他确实处于开发过程的早期,而另一个人已经存在了几年了。
http://joehewitt.github.com/scrollability/
Natively it is not possible, either with a div or iframe, so it must be solved with javascript listening for the touch events. I'm researching this same problem for a project and at the moment I have found a couple javascript libraries that are solving this problem.
I'm looking into this one at the moment, but I haven't commited to it yet.
http://cubiq.org/iscroll-4
Joe Hewitt of Three20 fame has recently started dev on solution for this as well, but he's really early in dev process where as the other one has been around for a couple years now.
http://joehewitt.github.com/scrollability/
你可以只用一根手指,但你必须提供内部DIV的style.height
You can use just One finger, but you have to provide style.height of the inner DIV