title: jQuery delay between animations
body: <p>I have two elements that shouldn't be active at the same time, so when one is toggled I fade the other out, however I would like to be able to fade the open element out and then bring the other one in. Is there a way to do this that isn't a hack?</p>
  
  <pre><code>&lt;script ="text/javascript"&gt;
  
  $(function() {
      $('#jlogin').click(function() {
          $('#login').toggle('fast');
          $('#reg').fadeOut('fast');
      });
  
      $('#jreg').click(function() {
          $('#reg').toggle('fast');
          $('#login').fadeOut('fast');
      });
  });
  
  &lt;/script&gt;
  </code></pre>
  
  <p>That is my current script.</p>