js浮动层定位求问解决方法

<script> $.fn.smartFloat = function() { var position = function(element) { var bottom = element.position().bottom, pos = element.css("position"); $(window).scroll(function() { var scrolls = $(this).scrollTop(); if (scrolls > bottom) { if (window.XMLHttpRequest) { element.css({ position: "fixed", bottom: 0 }); } else { element.css({ bottom: scrolls }); } }else { element.css({ position: pos, bottom: bottom }); } }); }; return $(this).each(function() { position($(this)); }); }; //绑定 $("#float").smartFloat(); </script> 我想找的js和这个类似,但是是永远居低部的效果,无论你的滚动怎么拉,他都是永远在最底部

------解决方案--------------------
js设置fixed -->
js浮动层定位求问
网上也找了很多,但是绝大部分都是找到的这个。
JScript code

<script>
$.fn.smartFloat = function() {
    var position = function(element) {
        var bottom = element.position().bottom, pos = element.css("position");
        $(window).scroll(function() {
            var scrolls = $(this).scrollTop();
            if (scrolls > bottom) {
                if (window.XMLHttpRequest) {
                    element.css({
                        position: "fixed",
                        bottom: 0
                    });    
                } else {
                    element.css({
                        bottom: scrolls
                    });    
                }
            }else {
                element.css({
                    position: pos,
                    bottom: bottom
                });    
            }
        });
    };
    return $(this).each(function() {
        position($(this));                         
    });
};

//绑定
$("#float").smartFloat();
</script>

我想找的js和这个类似,但是是永远居低部的效果,无论你的滚动怎么拉,他都是永远在最底部



------解决方案--------------------
js设置fixed