javascript delay function is not working
<p>I am using javascript-based modal dialog. The dialog is fading in and fading out fine, but if I want the fadeout to be delayed by some seconds using delay(3000), it is not working. It simply never fades out.  What could I be doing wrong?  It's an MVC app.</p>

<pre><code>function testingh(button) {
                alert("DfdfdfF");
                 $('.error-notification').remove();
            var $err = $('&lt;div&gt;').addClass('error-notification')
                                 .html('&lt;h2&gt;Paolo is awesome&lt;/h2&gt;(click on this box to close)')
                                 .css('left', $(button).position().left);
            $(button).after($err);
            $err.fadeIn('slow');
            $err.delay(3000).fadeOut('slow');
            }
</code></pre>

<p>If you know of a more efficient way to delay(meaning postpone) the fading out, then let me know. using delay(3000).fadeOut seemed most efficient to me?  </p>

<p>CSS:</p>

<pre><code>.error-notification {
    background-color:#AE0000;
    color:white;
    cursor:pointer;
    display: none;
    padding:15px;
    padding-top: 0;
    position:absolute;
    z-index:1;
    font-size: 100%;
}

.error-notification h2 {
    font-family:Trebuchet MS,Helvetica,sans-serif;
    font-size:140%;
    font-weight:bold;
    margin-bottom:7px;
}
</code></pre>
