我使用了以下代码,但它无效:
$("#divID").scroll(function(){
if ($("#divID").scrollTop() == $("#divID").height() - $("#divID").offset().top){
alert(1);
}
});
divID
是div的ID。
答案 0 :(得分:2)
$("#divID").scroll(function(){
if($(this)[0].scrollHeight - $(this).scrollTop() <= $(this).outerHeight())
{
alert(1);
}
});