How to wait for the elements' animation queues to get empty?

Compact syntax with timing methods:

1
$('.some').wait().doSome().jQueryStuff();

The similar join() method provides more options when waiting for animations.

Compare this to the old way with more syntactic fluff:

1
2
3
$('.some').promise().then(function(){
  $('.some').doSome().jQueryStuff();
});

Similar patterns with animations

Similar patterns with promises