📌  相关文章
📜  检查是否滚动到 div 的底部 - 无论代码示例

📅  最后修改于: 2022-03-11 14:59:26.855000             🧑  作者: Mango

代码示例1
window.addEventListener("scroll", () => {
    var offset = element.getBoundingClientRect().top - element.offsetParent.getBoundingClientRect().top;
    const top = window.pageYOffset + window.innerHeight - offset;

    if (top === element.scrollHeight) {
        console.log("bottom");
    }
}, { passive: false });