Friday, May 10, 2024
 Popular · Latest · Hot · Upcoming
-2
rated 0 times [  5] [ 7]  / answers: 1 / hits: 46598  / 12 Years ago, mon, september 3, 2012, 12:00:00

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


More From » jquery

 Answers
4

Try:



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


JsFiddle


[#83278] Saturday, September 1, 2012, 12 Years  [reply] [flag answer]
Only authorized users can answer the question. Please sign in first, or register a free account.
yusuf

Total Points: 167
Total Questions: 97
Total Answers: 108

Location: North Korea
Member since Tue, Jun 16, 2020
4 Years ago
;