如图,黑线框起来的就是随屏滚动部分,但是侧边栏比较长,有时会超过正文,这时就会穿过footer,有什么方法可以让footer在随屏滚动的下面,本人菜鸟,最好简单点jquery代码如下:jQuery(document).ready(function($){  
$.fn.smartFloat = function() {   
    var position = function(element) {   
        var top = element.position().top, pos = element.css("position");   
        $(window).scroll(function() {   
            var scrolls = $(this).scrollTop();   
            if (scrolls > top) {   
                if (window.XMLHttpRequest) {   
                    element.css({   
                        position: "fixed",   
                        top: 10   
                    });       
                } else {   
                    element.css({   
                        top: scrolls   
                    });       
                }   
            }else {   
                element.css({   
                    position: "absolute",   
                    top: top   
                });       
            }   
        });   
    };   
    return $(this).each(function() {   
        position($(this));                            
    });   
};   
     
$(".xxxx").smartFloat();   
 
});