I call this functions on onmouseover and onmouseout for several divs.
//Takes effect on divs with id, 62,63,64,65...
function slide_it(id){
$('#options_'+id).slideToggle('slow');
}
The problem is that if I move my mouse over and then mouse out, then again, mouse over and then mouse out. If I do this several times, the slide effect happens the same number of times I moved my mouse over and out of the div, as expected.
But I can’t figure out how I can do this once? I can set a variable, but I have several divs that this function is used by and I can’t think of a simple way of doing this rather than storing things into an array, but this is messy!
I really appreciate any help on this that is simple to implement!
Thanks all for any help
Before you call
slideToggle(), use.stop(true), this ends the current animation (if there is one), and since you’re chaining, will immediately start the animation you’re providing, like this:From the docs:
Example: if you hover in and out fast, i doesn’t wait to finish sliding it, it stops it and begins sliding out as soon as the mouse leaves.