jquery - How to reverse the animation using delay? -


i adding class div expand height. once height reached, making each of span appear dealy.

when user clicks back, removing height of div. before need roll-back span fade last. (3,2,1)

how it?

here code :

$('button').click(function () {      $('.parent').toggleclass('active');      $('.parent').on('animationend webkittransitionend', function() {                 $('span').each(function (i) {                     $(this).delay(i*1000).queue(function (next) {                         $(this).addclass('fadein');                         next(); //used dequeue                     });                 });             })  }); 

live demo


Comments

Popular posts from this blog

c# - Validate object ID from GET to POST -

node.js - Custom Model Validator SailsJS -

php - Find a regex to take part of Email -