scrollTop with jQuery

Posted by Narcís on Stack Overflow See other posts from Stack Overflow or by Narcís
Published on 2012-09-21T15:36:38Z Indexed on 2012/09/21 15:37 UTC
Read the original article Hit count: 175

Filed under:

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'});
        }
    });

 })

© Stack Overflow or respective owner

Related posts about jQuery