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?
Comment
Watch Question

ioboxWeb Architect

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

cheers...

of course change #divtoslide with your div id...
<script type="text/javascript">
   $(document).ready(function(){
     $('#divtoslide').slideUp();
   });
</script>


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

Open in new window

Christopher Gore , MBAEnterprise Solutions Architect

Author

Commented:
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
Commented:
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.