本文共 452 字,大约阅读时间需要 1 分钟。
条件:
1 | $( "div" )[0].scrollTop + $( "div" ).height() == $( "div" )[0].scrollHeight |
完整滚动事件:
1 2 3 4 5 6 7 8 9 10 11 | var nScrollHight = 0; var nScrollTop = 0; var nDivHight = $( ".div" ).height(); $( ".div" ).scroll( function () { nScrollHight = $( this )[0].scrollHeight; nScrollTop = $( this )[0].scrollTop; if (nScrollTop + nDivHight == nScrollHight) { alert( "滚动条到底部了" ); }; }); |