如何检测div滚动条何时向上滚动并触顶(仅当触顶时)
我找到了另一篇文章,但这篇文章已被搁置。
我需要的是达到顶峰。有人知道如何更改吗?
$("#divID").scroll(function(){
if($(this)[0].scrollHeight - $(this).scrollTop() <= $(this).outerHeight())
{
alert(1);
}
});
最佳答案
var el = $('.test');
el.on('scroll', function(){
if(el.scrollTop() == 0){alert("i just hit the top")}
});
关于javascript - 检测div滚动条是否触顶,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/17946575/