Manixa Posted December 22, 2011 Share Posted December 22, 2011 Im sure most of you who have used jquery to animate stuff have ran into this problem. I have a few animations using the .animate function and my problem is that when I rapidly trigger the animation it starts doing it the amount of times I have clicked, my question is how can I code it that so when I click it starts the animation and disregards any farther clicking untill the animation is over? Quote Link to comment Share on other sites More sharing options...
scootstah Posted December 22, 2011 Share Posted December 22, 2011 Use .stop() before the animation. Quote Link to comment Share on other sites More sharing options...
Manixa Posted December 22, 2011 Author Share Posted December 22, 2011 no, not really, I just want the function that triggers the animation to be disabled for the duration of the animation.. something like that :? Quote Link to comment Share on other sites More sharing options...
scootstah Posted December 22, 2011 Share Posted December 22, 2011 You could do something like set a disable variable to false. Then before your animation, if disable == true, don't run the animation. If not, set to true and then after the animation runs set back to false. Quote Link to comment Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.