Html 在 Iphone 上滚动不起作用
声明:本页面是StackOverFlow热门问题的中英对照翻译,遵循CC BY-SA 4.0协议,如果您需要使用它,必须同样遵循CC BY-SA许可,注明原文地址和作者信息,同时你必须将它归于原作者(不是我):StackOverFlow
原文地址: http://stackoverflow.com/questions/15454998/
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
Scrolling not working on Iphone
提问by Steven
I have the following div and the native scrolling does not work on it. Is there anything from this code that could possible be caused the scrolling to fail? Or is there something I can add to this to make the scrolling work?
我有以下 div 并且本机滚动不起作用。此代码中是否有任何可能导致滚动失败的内容?或者我可以添加一些东西来使滚动工作?
<div id='calvw' style='overflow= hidden;'>
<a id='calevvw' dhx_l_id='#id#' data-ajax='false' href='eventview.php?eventid=#id#'
class='dhx_list_item dhx_list_day_events_time'
style='width:{common.widthSize()}; height:{common.heightSize()};
border-bottom: 1px solid #cbcbcb; padding:{common.padding}px;
margin:{common.margin}px; overflow:hidden;'>
</a>
</div>
回答by Charlie
If the div you are tying to have scroll is #calvw
, this won't work, as you have overflow:hidden
on it.
如果您要绑定的 div 是#calvw
,这将不起作用,就像您overflow:hidden
在上面那样。
Change the css of that element to:
将该元素的 css 更改为:
overflow:scroll;
-webkit-overflow-scrolling:touch;
To enable native, momentum scrolling.
启用原生的动量滚动。