1
2
3
4
jQuery( "#test" ).on( "click", "button", function() { var _this = jQuery(this); _this.prop( "disabled", true ).text( "Работаем" ); _this.closest( "div" ).find( "div" ).each(function( i, o ) { jQuery( o ).slideToggle( 1000 * ( i + 1 ) ); }).promise().done(function() { _this.prop( "disabled", false).text( "Жмем" ); }); });