在页脚Jquery停止Float

我用这个代码:

$(window).scroll(function () { if (($(document).height() - $(window).scrollTop()) = 30) { $("#content-5").css({ position: 'fixed', top: '30px', bottom: 'auto' }); }else{ $("#content-5").css({ position: 'absolute', top: '30px', bottom: 'auto' }); } 

});

这是演示

http://jsfiddle.net/Ym2Ga/75/

它的工作正常,但我不知道怎么办,那个浮动元素停在页脚。 有人可以帮忙吗?

我已经更新了你的小提琴….改变你的第一块css为……

$("#content-5").css({ position: 'fixed', top: '0px', bottom: 'auto' });

fiiddle