$(document).ready(function() { $("#scroll_div").scroll(function(){ var divHeight = $(this).height(); var nScrollHeight = $(this)[0].scrollHeight; var nScrollTop = $(this)[0].scrollTop; $("#input1").val(nScrollHeight); $("#input2").val(nScrollTop); $("#input3").val(divHeight); if(nScrollTop + divHeight >= nScrollHeight) { alert("到达底部了"); } }); });