How to stop toggle event from being fired multiple times on mouseenter/mouseleave?
Posted
by Clean
on Stack Overflow
See other posts from Stack Overflow
or by Clean
Published on 2010-04-09T08:20:56Z
Indexed on
2010/04/09
8:23 UTC
Read the original article
Hit count: 310
JavaScript
|jQuery
Hi,
I'm using jQuery to toggle the visibility of a using the jQuery toggle method. The toggle is fired on the mouseenter and mouseleave event, thus creating the effect of the div to fold out on mouseenter and fold in on mouseleave. Problem is, if the user drags the mouse over the a few times and then leaves the , the div will toggle in and out several times. This can happen if the user accidentally moves around the mouse pointer in the are. Do anyone have any idea on how I can avoid this behavior?
Thanx!
© Stack Overflow or respective owner