css - Why does addClass() work before start animation in jQuery? -
i use queue()
. cannot div turned red only after animation ends.
how correctly?
fiddle: http://jsfiddle.net/hrt6u/
html:
<div class="ext_div"> <div> <span>a</span> </div> </div>
js code:
$("div.ext_div div").queue( function() { $(this).animate({opacity: "1", right: "400px"}, {duration : 1200, step : function() { $(this).css("overflow", "visible"); $(this).addclass("animation_end"); } }).dequeue(); });
change "step" "complete" this:
$(document).ready(function() {
$("div.ext_div div").queue( function() { $(this).animate({opacity: "1", right: "400px"},{duration : 1200, complete : function() { $(this).css("overflow", "visible"); $(this).addclass("animation_end"); } } ).dequeue(); }); return false; });
Comments
Post a Comment