判断一个元素是否出现在视野中
-
$(window).height()
屏幕的高度 -
$(window).scrollTop()
屏幕滚动的高度 -
$(node).setoff().top
元素到页面顶部的高度
$(node).setoff().top
<= $(window).height()
+ $(window).scrollTop()
则元素出现在视野中
http://js.jirengu.com/yinun/1/edit?js,console,output
判断是否滚动到最底部
滚动的高度(scrollTop)+ 可视内容的高度(clientHeight)= 内容的总高度(scrollHeight)
具体的说明还没整理