简体   繁体   English

Android在HTML容器内滚动,该容器具有CSS溢出属性

[英]Android scrolling inside HTML containers, which has a CSS overflow property

I have a container on a page, which has has a huge overflow-x. 我在页面上有一个容器,其中有一个巨大的x溢出。 On a iPad, the user can simple swipe-scroll left, just like they would do vertically when scrolling down the page. 在iPad上,用户可以简单地向左滑动,就像向下滚动页面时垂直滑动一样。

On a PC, scrollbars are visible so the user can scroll left and right. 在PC上,滚动条是可见的,因此用户可以左右滚动。

However, on the Android, no scroll bars appear and I can't swipe left like I can on the iPad. 但是,在Android上,没有滚动条出现,并且我无法像在iPad上那样向左滑动。

Is some special CSS and JS needed here? 这里需要一些特殊的CSS和JS吗? Does anyone know why this happens? 有谁知道为什么会这样吗?

The overflow property is not working properly in Android devices before Android 3.0. 在Android 3.0之前的版本中,overflow属性无法在Android设备中正常运行。 But it is solved from the Android 3.0 or later. 但这是从Android 3.0或更高版本解决的。

I also had this issue while I was developing an application. 在开发应用程序时,我也遇到了这个问题。

This issue was solved by using a button and animating the element's margin-top property so that it is changed to negative value, therefore creating a scroll effect. 通过使用按钮并设置元素的margin-top属性动画效果可以解决此问题,从而将其更改为负值,从而创建滚动效果。

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

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