开发者

Mozilla Firefox: show/hide triggers a mouseover event?

开发者 https://www.devze.com 2023-04-12 20:29 出处:网络
Let\'s say you have a <div> element which is hidden. There is a mouseover event attached to it and the mouse cursor is placed at the location where the <div> element will appear once it i

Let's say you have a <div> element which is hidden.

There is a mouseover event attached to it and the mouse cursor is placed at the location where the <div> element will appear once it is visible.

How I开发者_如何学JAVA can prevent the mouseover event from firing when the <div> is made visible?


You can't. The event is fired when the mouse is over a new element in Gecko, whether due to the mouse moving or elements moving. This is quite purposeful; it makes things like CSS :hover work correctly when the mouse is not moving.

0

精彩评论

暂无评论...
验证码 换一张
取 消

关注公众号