How to properly use delay function
<p>The delay function isn't working as I expect it should. I'm sure I'm doing something wrong. I have an overlay that I want to use. When a user clicks a link, I'd like this function to delay for 1 second and then "release", allowing the user to go to the link they clicked on. How can I do this?</p>

<pre><code>     $("body").append("&lt;div id='overlay'&gt;&lt;/div&gt;");
     $("#overlay").height(docHeight).css({
...
      }).delay(1000);  &lt;-- This is where I think it should go...
    });
</code></pre>

<p><strong>EDIT:</strong></p>

<p>I've tried both solutions offered but I can't get the overlay to hold. The screen just refreshes in about half a second. It's ignoring the setTimeout function. What I did to test the setTimeout function was the following but I don't even get the alert. I'm assuming that I would put my overlay code in place of where I have the alert(), right?</p>

<p>Just for clarity, what I expect to see is a 1 second delay when the .load selector is clicked then the user forwarded to the link they clicked.</p>

<pre><code>  $('.load').click(function() {
    setTimeout(function(){
      alert();
    }, 1000);
  });
</code></pre>
