 <p>You can set background on animation complete callback something like this:</p> <pre><code>$('#SwWcSbDoTh').on('click',function(){ $('#B').animate({opacity: 1,complete:function(){ $("body").css("opacity","0.25");}},1000); }); </code></pre>