Javascript 有什么办法可以让ipad中的div滚动?

声明:本页面是StackOverFlow热门问题的中英对照翻译,遵循CC BY-SA 4.0协议,如果您需要使用它,必须同样遵循CC BY-SA许可,注明原文地址和作者信息,同时你必须将它归于原作者(不是我):StackOverFlow 原文地址: http://stackoverflow.com/questions/3495886/
Warning: these are provided under cc-by-sa 4.0 license. You are free to use/share it, But you must attribute it to the original authors (not me): StackOverFlow

提示:将鼠标放在中文语句上可以显示对应的英文。显示中英文
时间:2020-08-23 04:54:05  来源:igfitidea点击:

Any way to make div scroll in ipad?

javascriptjqueryipad

提问by cat

I have tried so many different things and I keep searching but I find nothing!

我尝试了很多不同的东西,我一直在寻找,但什么也没找到!

Help anyone?

帮助任何人?

采纳答案by edtechdev

See if this helps, the guy says the div must have a fixed size: http://uxebu.com/blog/2010/04/27/touchscroll-a-scrolling-layer-for-webkit-mobile/

看看这是否有帮助,这家伙说 div 必须有固定大小:http: //uxebu.com/blog/2010/04/27/touchscroll-a-scrolling-layer-for-webkit-mobile/

If that's not what you are looking for, you might also check out jqtouch and things like this jqt.scroll extension: (sorry, I can only post 1 link apparently, look for jqt.scroll.js on this site: code.google.com/p/jqextensions/ )

如果这不是您要查找的内容,您还可以查看 jqtouch 和类似 jqt.scroll 扩展的内容:(抱歉,我显然只能发布 1 个链接,请在此站点上查找 jqt.scroll.js:code.google。 com/p/jqextensions/ )

回答by Igor Krupitsky

Css Solution

css解决方案

-webkit-overflow-scrolling: touch;

回答by Elwin

use TWO fingers on the div!!! That's it

在 div 上使用两个手指!!!就是这样

回答by webXL

iScroll: http://cubiq.org/iscroll-4

iScroll:http://cubiq.org/iscroll-4

Looks/Works just like the native controls that have one-finger scrolling.

看起来/工作起来就像具有单指滚动的本机控件一样。

回答by Michael

I've had great luck with this on all browsers and platforms - including iPad: http://www.kelvinluck.com/assets/jquery/jScrollPane/jScrollPane.html

我在所有浏览器和平台上都非常幸运 - 包括 iPad:http: //www.kelvinluck.com/assets/jquery/jScrollPane/jScrollPane.html

But, really it is just fancy-ing up the basic overflow: autoeffect on an element

但是,实际上它只是幻想对overflow: auto元素的基本效果

回答by Kaloyan Stamatov

I had very unusual issue for iPhone 6 with scrolling container, which parent has max-height:100%; This style somehow was disabling the scrolling. When I change the parent container style to height: 100% it works, but the point was to preserve the max-height. So the fix was to add

对于带有滚动容器的 iPhone 6,我遇到了非常不寻常的问题,其父级具有 max-height:100%;这种风格以某种方式禁用了滚动。当我将父容器样式更改为 height: 100% 时,它可以工作,但重点是保留最大高度。所以修复是添加

-webkit-transform: translate3d(0, 0, 0)

-webkit-transform: translate3d(0, 0, 0)

Hope this is helpful, I lost entire afternoon fighting with it.

希望这是有帮助的,我整个下午都在与它斗争。