When animating, how fire the callback only when all elements are done?

Posted by Maria Söderberg on Stack Overflow See other posts from Stack Overflow or by Maria Söderberg
Published on 2010-05-24T13:22:01Z Indexed on 2010/05/24 13:31 UTC
Read the original article Hit count: 190

Filed under:
|
|

When animating in jQuery, what's best practice for firing a callback only when ALL elements are done animating and not for each element?

For example:

$('.someElements').fadeOut('fast', function() {
  // dont do this until ALL elements are done fading
}

© Stack Overflow or respective owner

Related posts about jQuery

Related posts about animation