title: Wait for two events with jQuery and execute a callback when both are done
body: <p>I have a <code>.click()</code> event on an element. After it's closed, this mob has a transition that happens and an AJAX call that goes through. That's all that happens.</p>
  
  <p>What I need is a callback to put inside the <code>.click()</code> function to execute when both of those things are done, even if transitions aren't supported. Here's a timeline:</p>
  
  <p>jQuery needs to wait for the ajax call and the transition, then execute the callback after the ajax call has completed AND the transition has either finished or not happened at all.</p>
  
  <p>How can I do this? Thanks!</p>
  
  <p><em>NOTE: I'm using <code>$.ajax()</code> for the ajax call and a normal CSS3 transition on the element in question. I can detect transitionEnd with javascript event binding, I have a variable setup for that called transitionEnd and another variable that detects if the browser support transitions call supportsTrans.</em></p>