如何檢測Div時滾動條,滾動起來,打頂(只有當它擊中頂部)檢測DIV滾動條打在上面
我已經找到了另一篇文章,但是這一次是見底。
我需要的是擊中頂部。任何人都知道如何改變這一點?
$("#divID").scroll(function(){
if($(this)[0].scrollHeight - $(this).scrollTop() <= $(this).outerHeight())
{
alert(1);
}
});
Know when vertical scrollbar hits bottom of scroll in div
這似乎很複雜,爲什麼不嘗試一些事情簡單! –