如何逐步检测支持触摸的设备是否支持溢出滚动?
Android 3.0 (Honeycomb) 现在可以在浏览器中支持溢出滚动 。在旧版本的 Android 中,我必须编写自己的 JavaScript 来滚动内部框架、溢出内容和其他元素内的内容,以弥补此问题。此缺陷已记录在 Android 错误跟踪器中,问题为 2118 、6864、7776,以及其他一些类似的问题。
在新版本的 Android 中,我希望浏览器能够自行处理此功能(如果有能力的话)。除了嗅探用户代理之外,还有其他方法可以嗅探对此的支持吗?我更愿意检查该功能的支持,而不是黑客用户代理嗅探。
我尝试过检查对 scroll
事件的支持,但旧的 Android 浏览器和 Honeycomb 似乎已经有此事件。
jQuery mobile 似乎也不检查是否支持溢出滚动。它们仅检测设备是否支持触摸事件。
Android 3.0 (Honeycomb) now properly supports overflow scrolling in its browser. In older versions of Android, I've had to write my own JavaScript to scroll content within internal frames, overflowed content, and other elements to compensate for this issue. This shortcoming has been documented in the Android bug tracker with issues 2118, 6864, 7776, and a few other similar issues.
With the new release of Android, I'd prefer the browser handle this feature itself, if it's capable. Is there a way to sniff for support of this aside from just sniffing the user agent? I'd prefer to check for support of the feature over hacky user agent sniffing.
I've tried checking support of the scroll
event, but both old Android browsers and Honeycomb seem to already have this event.
jQuery mobile also doesn't seem to check for support of overflow scrolling. They only detect whether or not the device supports touch events.
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论