I\'m looking to animate a div element from an absolute top position to an absolute bottom position on the page load.
The combination of CSS and jQuery code below fai
You can set top:auto with .css method and then animate:
$(document).ready(function(){
$("#line-three").css({top:'auto'});
$("#line-three").animate({bottom:'100px'}, 200)
})
EDIT:
You can play with size of body/screen and convert top position to bottom position and then animate to the desired bottom position:
$(document).ready(function(){
var bodyHeight = $('body').height();
var footerOffsetTop = $('#line-three').offset().top;
var topToBottom = bodyHeight -footerOffsetTop;
$('#line-three').css({top:'auto',bottom:topToBottom});
$("#line-three").delay(100).animate({
bottom: '100px',
}, 1200);
})
Example: http://jsfiddle.net/reWwx/4/