简体   繁体   English

phonegp应用程序中的android浏览器滚动问题

[英]android browser scrolling issue in phonegp application

In my phonegap application scrolling working fine in some of the devices (android ), but in some of the devices scrolling content does not work. 在我的phonegap应用程序中,滚动在某些设备(android)中可以正常工作 ,但是在某些设备中, 滚动内容不起作用。

Simple structure of my page as below : 我的页面的简单结构如下:

------------Header----------- ------------页眉-----------

------------content----------- - - - - - - 内容 - - - - - -

------------footer------------- ------------页脚-------------

Sample Code : 样例代码:

<div id="header"> </div>

<div id="content"> 
This content does not scroll when overflow
</div>

<div id="footer"></div>


Header and footer is fixed size and position ( top and bottom).

When i try to scroll content area it will not work in some of the android devices. 当我尝试滚动内容区域时,它将无法在某些android设备中使用。

Thanks in advance for solution. 在此先感谢您的解决方案。

You can use iScroll or NiceScroll js plugin for smooth scrolling of the content. 您可以使用iScroll或NiceScroll js插件来平滑滚动内容。

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

http://areaaperta.com/nicescroll/ http://areaaperta.com/nicescroll/

hi You can use overflow scroll option in css but Android 3.0 and higher have support for overflow:scroll, < 3.0 it's not support . 嗨,您可以在CSS中使用“ 溢出滚动”选项,但Android 3.0及更高版本支持“ overflow:scroll”, <3.0不支持 for that you can use iscroll http://cubiq.org/iscroll-4 or any other plugin. 为此,您可以使用iscroll http://cubiq.org/iscroll-4或任何其他插件。

First of all if you are making the application using html then you have to set a touchable scroller. 首先,如果要使用html制作应用程序,则必须设置一个可触摸的滚动条。 Their is various plugin available in the market. 他们是市场上可用的各种插件。 So you can use any of them. 因此,您可以使用其中任何一个。

But there is some scroller which is not supported by android. 但是有一些Android不支持的滚动条。 You have to choose correct one for it. 您必须为此选择正确的一个。 I am giving you a link where you can find a scroller. 我给您一个链接,您可以在其中找到滚动条。 I have used it. 我用过了 It will work like a charm. 它将像魅力一样工作。

http://areaaperta.com/nicescroll/ http://areaaperta.com/nicescroll/

you can try using style properties for <div> 您可以尝试将样式属性用于<div>

overflow and overflow-y ,for me its working fine. 溢出溢出-对我来说,它的工作正常。

<div style='height: 190px; overflow: auto; overflow-y: scroll !important;'>

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM