Postpone execution of code inside document.ready()
<p>I have a document.ready function that I am using to slide toggle and it looks like this:</p>

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


    if ($("div[id='feature-content']").is(":visible")) {
    $("div[id='feature-content']").hide();
    $("div[id='feature-content']").slideToggle(9000).delay(4000);
    }

    $("div[id='feature-content']").slideToggle(9000).delay(4000);


    });

});
</code></pre>

<p>I want the slide toggle to occur only after say, 5 secs, after rendering the page. So I modified the above code by including a setTimeOut() like below:</p>

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

    window.setTimeout(function() {

        if ($("div[id='feature-content']").is(":visible")) {
        $("div[id='feature-content']").hide();
        $("div[id='feature-content']").slideToggle(9000).delay(4000);
        }

        $("div[id='feature-content']").slideToggle(9000).delay(4000);


        });
    }
    ,
    15000
    );
}); 
</code></pre>

<p>But I am not able to get it to work. Can someone help me to accomplish my objective?</p>

<p>Thank you.</p>
