title: How to use jQuery promise with element animations?
body: <p>How can I invoke a callback after 2 animations completed? The animations should happen at the same time, but after both are complete a callback should run.</p>
  
  <p>I have this so far:</p>
  
  <pre><code>$element1.animate({top: element2_pos}, 200);
  $element2.animate({top: element1_pos}, 200, function(){ /* callback code */ });
  </code></pre>
  
  <p>How do I combine that with a promise or deferred object? Is there a smart way to join both animations?</p>