Android 版 Chrome 浏览器不再支持 -webkit-overflow-scrolling?有替代方案吗? [英] Chrome Browser for Android no longer supports -webkit-overflow-scrolling? Is there an alternative?

查看:24
本文介绍了Android 版 Chrome 浏览器不再支持 -webkit-overflow-scrolling?有替代方案吗?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

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

I updated to the newest version of Chrome for Android on my Nexus 7 tablet and ...

-webkit-overflow-scrolling: touch

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

... no longer works. In addition, the following evaluates to false:

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

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

Was support for overflow scrolling removed from more recent builds of Chrome for Android? Is there an equivalent or comparable alternative momentum scrolling mechanism (not iScroll, etc.) that I can use found in the newest version?

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

As well, I searched for Chrome Beta in the Play Store on my device and it does not come up in the search results. Maybe the beta version is not offered for Nexus 7 tablets?

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

Any help on this matter is much appreciated. It's very frustrating that Google appears to have removed this feature from their browser ....

详细版本信息:

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

Nexus 7 tablet running Android version 4.2.2

-webkit-overflow-scrolling: touch;

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

  • 在 Chrome 版本 18.0.1025469 上运行并评估为 true
  • 在 Chrome 版本 26.0.1410.58 上不起作用并评估为 false
  • 推荐答案

    尝试将 z-index: 0 添加到带有 overflow: scroll 的元素以创建堆叠-提示 Chrome 使用快速滚动代码路径的上下文.

    Try adding z-index: 0 to the element with overflow: scroll to create a stacking-context that provides a hint to Chrome to use the fast-scrolling code path.

    背景:

    在更新到最新版本的 Android 版 Chrome 后,我目前遇到了这个问题.由于这种变化,当前针对此功能的 Modernizr 测试现在返回 false,因此未应用我的 CSS 样式.

    I am currently experiencing this issue after updating to the latest version of Chrome for Android. This was also compounded for me by the fact that due to this change the current Modernizr test for this feature now returns false, so my CSS styles were not being applied.

    我发现另一个问题讨论了支持溢出滚动触摸:

    Digging around I found another issue that discusses the support for overflow scrolling touch:

    Tien-Ren 在调试 162363 时观察到 -webkit-overflow-touch是继承财产.所以在所有设置 z-index: 0 的行为具有该属性的非隐藏元素会创建级联堆叠它下面的上下文.(这种行为,背后ENABLE_ACCELERATED_OVERFLOW_SCROLLING,目前仅在Android.)显而易见的解决方法是仅将 z-index: 0 设置为溢出:滚动"元素.

    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 添加到带有 overflow: scroll 的元素中,这可能会有所帮助.然而,这对我不起作用,尽管滚动部分有效(在我修改了 Modernizr css-overflow-scrolling 测试以针对此版本的 Chrome 返回 true 之后)滚动的动量效应不存在.

    So it would seem that if you are having issues with the scrolling not working as expected then adding z-index: 0 to the element with overflow: scroll then this may help. However this did not work for me, although the scrolling sections worked (after I had modified the Modernizr css-overflow-scrolling test to return true for this version of Chrome) the momentum effect of the scrolling was not present.

    这篇关于Android 版 Chrome 浏览器不再支持 -webkit-overflow-scrolling?有替代方案吗?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
相关文章
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆