How to wait 5 seconds with jQuery?
<p>I'm trying to create an effect where the page loads, and after 5 seconds, the success message on the screen fades out, or slides up.</p>

<p>How can I achieve this?</p>

<h2>Solution:</h2>

<p>There are a few different ways to achieve this:</p>

<ul>
<li><a href="http://www.w3schools.com/js/js_timing.asp">Javascript's built-in setTimeout method</a></li>
<li><a href="http://api.jquery.com/delay/">jQuery's delay method</a> (available in jQuery 1.4+)</li>
</ul>

<p>Example:</p>

<pre><code>$(document).ready(function(){

    setTimeout(function(){
        $('.my-element').fadeIn();
    }, 5000);

    // or...

    $('.my-element').delay(5000).fadeIn();

});
</code></pre>
