Reputation: 11000
The reason I ask is because I want to disable clicking of a show button WHILE the element it is animating is in the process of being animated.
Upvotes: 3
Views: 89
Reputation: 342635
if($("#someElement").is(":animated")) {
...
}
if($("#someElement:animated").length) {
...
}
// etc
So you can do:
$("#showBtn").attr("disabled", $("#someElement").is(":animated"));
http://api.jquery.com/animated-selector/
Upvotes: 2
Reputation: 14327
Use the :animated
selector:
var isAnimated = $('#button').is(':animated');
http://api.jquery.com/animated-selector/
Upvotes: 2