title: How to fade out a page then direct to a new page
body: <p>I was just wondering how to fade out a page then open up another html page. Right now I have:</p>
  
  <pre><code>&lt;div class="close" onclick="window.location.href='../index.html';"&gt;
      &lt;div class="lr"&gt;
          &lt;div class="rl"&gt;&lt;/div&gt;
      &lt;/div&gt;
      &lt;script&gt;
          $(function() {
            $('.close a').click(function() {
              var destination = this.href;
              $('body').fadeOut(2000, function() {
                  window.location = destination;
                });
              });
              return false;
            });
          });
      &lt;/script&gt;       
  &lt;/div&gt;
  </code></pre>
  
  <p>I want it so that when "close" is clicked, the page fades out then then opens up my index.html page?</p>
  
  <p>Currently my code is not working :(.</p>
  
  <p>Thanks in advance!</p>