We help IT Professionals succeed at work.

jquery slideUp div after page load

I am trying to hide a div as a page loads and after the page loads, I would like to use jQuery to slideUp a div.  I do not want to have a click event.  I want the div to slideUp after the page finishes loading.  How would I do that?
Watch Question

ioboxWeb Architect

this will make your div to slide without click :-)


of course change #divtoslide with your div id...
<script type="text/javascript">

<div id="divtoslide">
div content...

Open in new window

Christopher Gore , MBAEnterprise Solutions Architect


Unfortunately, slideUp actually works by hiding the element.  I actually want the opposite.  I am trying to show the element with a slideUp effect.  Any thoughts?
Enterprise Solutions Architect
I figured it out. My div loads between two others like layers. So the middle div starts with a width of 1024 and 0 height.  It is hidden behind the other div's at this point.  I then add the following jQuery script.

$(document).ready(function() {
        $("#content").animate({height:768}, 2000);

This animates the height to the correct height and all is well in the kingdom.