window.innerHeight表示窗口高度
$(document).height()返回文檔高度
$(document).scrollTop()返回滾動條與頂部的距離,在最上部時為0,在最下部時為:$(document).height()-window.innerHeight
$(document).scroll( function() { if ($(document).scrollTop() + window.innerHeight == $(document) .height()) { loadMore() } });