开发者

How to disable initial mouseover

开发者 https://www.devze.com 2023-03-16 18:37 出处:网络
With jQuery (or pure javascript), if you set a mouseover handler, it will be triggered even if the mouse is initially on the element. How to disable that?

With jQuery (or pure javascript), if you set a mouseover handler, it will be triggered even if the mouse is initially on the element. How to disable that?

For example, look at facebook - place your mouse over the name of a friend in the feed.开发者_如何学Python A hovercard appears. Now refresh the page (without moving the mouse; F5) - the hovercard does not appear.


try mousemove instead of mouseover ;)

http://api.jquery.com/mousemove/


Wouldn't you just use mouseenter instead of mouseover to get that result?

0

精彩评论

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