自定义scrollBottom的值

jQuery中只有scrollTop和scrollLeft这两个属性,没有scrollBottom和scrollRight这两个属性。但是我们有很多时候还是要用到scrollBottom,可以根据页面的各种高度高度来获取scrollBottom.
$(window).height();//是文档窗口高度

$("div").offset().top//是标签距离顶部高度

$(document).scrollTop();//是滚动条高度

$("div").height();//是标签高度

scrollBottom+$("div").height()+[$("div").offset().top-$(document).scrollTop()]=$(window).height();

可得到scrollBottom=$(window).height()-$("div").offset().top-$("div").height()+$(document).scrollTop()。
posted @ 2014-11-11 13:58  蜡笔不小心  阅读(1309)  评论(0)    收藏  举报