scrollTop with jQuery
- by Narcís
I want a foot to be at the bottom of the page. But when the user makes the window smaller, the two divs come together, it would be better that begins the scroll and hides the foot. I don't know if I explain?
I have the code life here: http://jsfiddle.net/mdAsn/
$(function(){
$(document).scroll(function(){
var topDistance = $('#foot').scrollTop();
if(topDistance >= 420){
$('#foot').css({position: 'absolute',bottom:'10px'});
}
else{
$('#foot').css({position: 'absolute',top:'410px'});
}
});
})