粘性页脚不会在要求处停止,在底部反弹

时间:2013-03-05 18:36:05

标签: jquery html css

我使用scrollToFixed将页脚粘贴到页面底部,直到它碰到实际的页脚然后它应该停止。但是,它会滚动到页面底部并通过页脚和按钮到页脚顶部。任何想法为什么会发生这个错误?这是指向实际网站的链接:http://client.analog.la/ret5/

jQuery('#scroller').scrollToFixed({
    bottom: 0,
    limit:  function() { 
    var limit = 0;
        if (jQuery(window).height() > jQuery('#page').height()) {
            jQuery('#colophon').css({'position':'fixed','bottom':'0'});
            jQuery('#scroller').css({'position':'fixed','bottom':'40px'});
        }else {
             jQuery('#colophon').css({'position':'static'});
             limit = jQuery('#scroller').offset().top + 40;
        } return limit;
        }

});

1 个答案:

答案 0 :(得分:2)

您应该减去页脚的高度

在我的浏览器上它很好......对于#scroller而言,内容一直都在底部。您使用的是哪个版本/浏览器。

相关问题