Single finger Scrolling for inner contents (div/iframes) in iPhone Mobile Safari

三世轮回 提交于 2019-11-30 02:31:21
Arvind Thyagarajan

In CSS (for iOS 5):

-webkit-overflow-scrolling: touch;

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/

You can use just One finger, but you have to provide style.height of the inner DIV

<div id="container-div" style="overflow:hidden">
   <div id="inner-div" style="overflow-y:auto; height:1024px"> 
   <!-- IMPORTANT!! you must specify the height of the inner div to make it scrollable -->
易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!