scrollable div is not working in android emulator,iphone simulator

妖精的绣舞 提交于 2019-12-02 06:40:45

问题


I am using phonegap.
I want to keep a fixed header and footer,and i want to scroll the content in between them. For that i used div with:

div
{
    width: 249px;
    height: 299px;

    background-color:Gray;
    overflow-y: auto;
} 

style.
But the div is not scrolling.
But in browser it is fine.


回答1:


iOS doesn't allow scrolling within an element (div with overflow:scroll/auto or frames) so you can either design your site around that (usually for the best) or you can try iScroll, which is a javascript plugin designed to re-instate this ability:

http://cubiq.org/iscroll-4

Good luck.




回答2:


Div scrolling does work in iOS if this property is added:

-webkit-overflow-scrolling: touch



来源:https://stackoverflow.com/questions/6533681/scrollable-div-is-not-working-in-android-emulator-iphone-simulator

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!