android - Android 版 Chrome 浏览器不再支持 -webkit-overflow-scrolling?有替代方案吗?

标签 android google-chrome webkit scroll overflow

我在我的 Nexus 7 平板电脑上更新到最新版本的 Android 版 Chrome 并且...

-webkit-overflow-scrolling: touch

... 不再有效。此外,以下计算结果为 false:

!!('WebkitOverflowScrolling' in document.documentElement.style)

是否从最新版本的 Android 版 Chrome 中删除了对溢出滚动的支持?是否有可以在最新版本中找到的等效或类似的替代动量滚动机制(不是 iScroll 等)?

同样,我在设备上的 Play 商店中搜索了 Chrome Beta,但它没有出现在搜索结果中。也许 Nexus 7 平板电脑不提供测试版?

非常感谢您对此事的任何帮助。谷歌似乎已经从他们的浏览器中删除了这个功能,这非常令人沮丧......

编辑:

详细版本信息:

运行 Android 版本 4.2.2 的 Nexus 7 平板电脑

-webkit-overflow-scrolling: touch;

!!('WebkitOverflowScrolling' in document.documentElement.style)
  • 在 Chrome 版本 18.0.1025469 上运行并评估为 true
  • 在 Chrome 版本 26.0.1410.58 上不起作用并评估为 false

最佳答案

尝试使用 overflow:scrollz-index: 0 添加到元素中,以创建堆栈上下文,为 Chrome 提供使用快速滚动代码的提示路径。

背景:

我目前在更新到最新版本的 Android 版 Chrome 后遇到了这个问题。这也让我更加复杂的是,由于这种变化,current Modernizr test因为这个特性现在返回 false,所以我的 CSS 样式没有被应用。

四处挖掘,我发现了另一个 issue讨论了对溢出滚动触摸的支持:

Tien-Ren observed while debugging 162363 that -webkit-overflow-touch is an inherited property. So the behavior of setting z-index: 0 on all non-hidden elements with that property creates a cascade of stacking contexts below it. (This behavior, behind ENABLE_ACCELERATED_OVERFLOW_SCROLLING, is currently enabled only on Android.) The obvious fix would be to set z-index: 0 on only "overflow: scroll" elements.

因此,如果您遇到滚动无法按预期工作的问题,那么将 z-index: 0 添加到具有溢出的元素:滚动那么这可能会有所帮助。然而这对我不起作用,尽管滚动部分有效(在我修改了 Modernizr css-overflow-scrolling 测试以针对此版本的 Chrome 返回 true 之后)滚动的动量效应不存在。

关于android - Android 版 Chrome 浏览器不再支持 -webkit-overflow-scrolling?有替代方案吗?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/15906508/

相关文章:

android - 图像不适合摩托罗拉 Razr 4.7 屏幕

html - Chrome 中垂直 div 之间的 1px 未指定边框

android - -表格中的webkit-gradient导致Android中出现边框线

c++ - 使用 Webkit < 1.3 访问 Gtk+ 中的 DOM 元素

android - Media Player无法在Android中使用

java - BestPractices : Is it bad OOP to subclass standard classes into a new one that does same thing, 但 "presuming" future 有变化吗?

Android webview 'fixed positioning'替代方案

html - 什么 CSS 方法会删除 div 跨浏览器的轮廓

google-chrome - 让 Chrome(在 mac 上)询问我是否应该保存登录信息

c# - 是否有任何在 Windows 窗体应用程序中以最少设置使用 CefGlue 或 CefSharp 的示例?