Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

JQuery Animate() slide div up from bottom of page

Hopefully simple but tried implementing answers from other SO questions to no avail.

I have a div I that I want to slide up from the bottom of the page when the document loads. However, I just cant seem to get the JQuery working. Here is what I have:

#content {
    width: 640px;
    margin:auto;
    margin-top: 2000px;
}

$(function(){

$('#content').animate({MarginTop: '50px',} 1000);

});

Basically, I just want to shrink the margin-top distance when the page loads.

Can anyone point me in the right direction? Thanks

like image 350
MeltingDog Avatar asked Sep 03 '12 02:09

MeltingDog


1 Answers

Try:

$('#content').animate({'margin-top': '50px'}, 1000);

JsFiddle

like image 101
timidboy Avatar answered Oct 25 '22 20:10

timidboy