Bozho
Bozho

Reputation: 597076

How to disable initial mouseover

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. A hovercard appears. Now refresh the page (without moving the mouse; F5) - the hovercard does not appear.

Upvotes: 2

Views: 242

Answers (2)

Brad Mace
Brad Mace

Reputation: 27886

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

Upvotes: 0

genesis
genesis

Reputation: 50976

try mousemove instead of mouseover ;)

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

Upvotes: 4

Related Questions