Slide Effect happening too many times

Posted by Abs on Stack Overflow See other posts from Stack Overflow or by Abs
Published on 2010-05-16T10:13:22Z Indexed on 2010/05/16 10:20 UTC
Read the original article Hit count: 130

Filed under:
|

Hello all,

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

© Stack Overflow or respective owner

Related posts about JavaScript

Related posts about jQuery