简体   繁体   English

Android 4.0浏览器溢出:滚动和触摸/单击事件

[英]Android 4.0 browser overflow: scroll and touch/click events

I've run into a really annoying problem with the stock Android 4.0 browser. 现有的Android 4.0浏览器遇到了一个非常烦人的问题。 I have a div with overflow: scroll, and elements within which scroll horizontally if they exceed the length of the div. 我有一个带有溢出的div:滚动,如果元素超过div的长度,则元素在其中水平滚动。 The scrolling works fine, but for some reason (only in the Android browser), click/touch events attached to the elements within the div do not get triggered at all, unless you hold your finger on the element and let go EXACTLY at the point in which the highlighting disappears. 滚动效果很好,但是由于某种原因(仅在Android浏览器中),附加到div中元素的click / touch事件根本不会被触发,除非您将手指放在元素上并完全松开在其中突出显示消失。 Just wondering if anybody has encountered this problem and/or has any idea of how to fix it. 只是想知道是否有人遇到此问题和/或对如何解决它有任何想法。 Thanks. 谢谢。

So the bug seems to only occur when the element bound to a click/tap event within the scrolling container is an anchor (even without href attribute). 因此,该错误似乎仅在绑定到滚动容器中的click / tap事件的元素是锚点(即使没有href属性)时才会发生。 If it's any other type of element, it works fine. 如果是任何其他类型的元素,则可以正常工作。

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

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