IE 中捕获鼠标事件的延迟?

发布于 2025-01-07 21:47:20 字数 490 浏览 1 评论 0原文

我创建了一个 GWT 选取框,它使用一个循环,每隔几毫秒将文本向前移动几个像素。没有使用该元素,因为它不合规并且不受欢迎。没有使用 CSS3/HTML5,因为 IE 还不支持它。

现在我还添加了一个 mouseListener 来捕获 mouseover 和 mouseOut 事件,这样当鼠标悬停在选取框上时,滚动就会暂停。

一切在 chrome、Firefox、safari 等中都能完美运行。但 IE 不行(谢谢你,MSFT)!

当我将鼠标移入时,选取框会按预期暂停,但是当我将鼠标移出时,有时(不一致) - 特别是如果我快速移动鼠标,选取框直到半秒或一秒才会恢复滚动之后。看起来 IE 花了很多时间才意识到鼠标已离开选取框并触发事件。

StackOverflow 上有很多关于 IE 根本不捕获 MouseOut 事件的帖子,但这与我的经历不一样。看起来事件最终总是被捕获的,只是很多时候有 0.5~1.5 秒的延迟。

有谁知道可能是什么问题吗?

谢谢你!!!

I created a GWT marquee which works with a loop that moves the text a couple of pxs ahead every few mili-seconds. Did not use the element because it's not compliant and frowned upon. Did not use CSS3/HTML5 because IE does not (yet) support it.

Now I also added a mouseListener to capture the mouseover and mouseOut events, so that when the mouse is over the marquee, the scrolling pauses.

Everything works perfectly in chrome, Firefox, safari etc. But NOT IE (Thank you, MSFT)!

When I move the mouse in, the marquee pauses as expected, but when I move the mouse out, sometimes (not consistently) - especially if I move the mouse really quickly, the marquee doesn't resume scrolling until half a second or a second later. It looks like it's taking IE that much time to realize the mouse has left the marquee and trigger an event.

There are quite a few posts on StackOverflow about IE not capturing the MouseOut event at all, but that's not the same as my experience. It seems like the event is always captured eventually, just with a 0.5~1.5 second delay many of the times.

Does anyone have any ideas what might be the problem?

Thank you!!!

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。
列表为空,暂无数据
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文