javascript - run animation then remove element -
i tring run simple animation remove div since lies on buttons can not click them after animation.
js
$(".intro").eq(0).delay(800).animate({"opacity":"0"},1000 );
i tried doing remove element after animation removes before.
$(".intro").eq(0).delay(800).animate({"opacity":"0"},1000 ).remove();
remove in animate function's callback:
$(".intro").eq(0).delay(800).animate({opacity: 0}, 1000, function() { $(this).remove() });
alternatively, add complete function in option object:
$(".intro").eq(0).delay(800).animate({opacity: 0}, {duration: 1000, complete: function() {$(this).remove();}});
you can add more options it, easing example. check api doc
Comments
Post a Comment