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

Popular posts from this blog

java - Play! framework 2.0: How to display multiple image? -

gmail - Is there any documentation for read-only access to the Google Contacts API? -

php - Controller/JToolBar not working in Joomla 2.5 -