views:

22

answers:

1

Hello, I need an answer to the following question... I have the problem when I use slideToggle I can't handle it's animation query with .stop(), i can handle it with .stop(true,true) though but it cuts my animation. I want to handle it smoothly without any plugins for example : I want it to wait till the animation finishes. Thanks

A: 

In this case you just want the first argument of .stop() to be true, like this:

.stop(true)

The first argument clears the queue, the second one jumps to the end, if you just want the queue cleared, leave off the last true :)

Nick Craver
That doesn't work please try it like this :<script> $(document).ready(function(){ $('#lol').hover(function(){ $('#box').stop(true).slideToggle(); },function(){ $('#box').stop(true).slideToggle(); })}); </script> <style> #lol{ width:50px; height:50px; background : red;}#box {height:200px; width: 200px; background : blue;} </style><body> <div id="lol"> </div> <div id="box"> </div>It doesn't work I tried it before i asked this question but nice try...Correct me if I'm wrong Thanks
vanjadjurdjevic
and yea try rapidly moving over and out of the #box element(red box)
vanjadjurdjevic
@vanjadjurdjevic - You need to clear the height to get rid of that behavior with `.css('height','')` you can see a full example here: http://jsfiddle.net/NHsKk/
Nick Craver