Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How can I stop the Clicking function While it is finish Animation?

Tags:

jquery

I need to know how can I stop the clicking function while it finishing the Animation

here is my code

 $(function () {
     $('legend').click(function () {
         $(this).parent().find('.content').slideToggle("slow");
     });
 });
like image 950
Mohammad Ereiqat Avatar asked Sep 25 '11 18:09

Mohammad Ereiqat


1 Answers

Change your selector slightly to exclude :animated elements using :not:

 $(function () {
     $('legend').click(function () {
         $(this).parent().find('.content:not(:animated)').slideToggle('slow');
     });
 });

Working example: http://jsfiddle.net/andrewwhitaker/acKtG/

like image 63
Andrew Whitaker Avatar answered Nov 01 '22 00:11

Andrew Whitaker