jquery - How to make sure animations are executed in queue -
i have animate divs. need make sure button clicked old divs fade out before letting new divs fade in.
shownews: function() { var start = this.counter * this.displayatonce; var end = this.counter * this.displayatonce + (this.displayatonce - 1); (i=start; i<=end; i++) { this.news.eq(i).fadein(); } }, hideallnews: function() { this.news.fadeout(); }, navigatenews: function() { this.hideallnews(); this.shownews(); }, how make work?
jquery's animation functions take callback function parameter. start animations want execute after animation in callback.
example:
elememtstohide.fadeout(function() { elementstoshow.fadein(); });
Comments
Post a Comment