jQuery disable enable click event with fade -


how can disable click event before fadein , enable after fadeout?

my js code:

$('a').click(function(){ // disable click $('div').fadeout(400, function(){ $(this) .css('background','yellow') .fadein(1800, function(){} // enable click );}); }); 

i coulda use stop() need disable/enable plz modify http://jsfiddle.net/wbwrm/1/ thx

add class element, , don't run event when class there.

$('a').click(function () { var $this = $(this); if ($this.hasclass('noclick')) return; // disable click $this.addclass('noclick'); $('div').fadeout(400, function () { $(this).css('background', 'yellow').fadein(1800, function () { // enable click $this.removeclass('noclick'); }); }); }); 

Comments

Popular posts from this blog

javascript - backbone.js Collection.add() doesn't `construct` (`initialize`) an object -

php - Get uncommon values from two or more arrays -

Adding duplicate array rows in Php -