1. window.addEventListener('scroll', function() {
    2. const clientHeight = document.documentElement.clientHeight;
    3. const scrollTop = document.documentElement.scrollTop;
    4. const scrollHeight = document.documentElement.scrollHeight;
    5. if (clientHeight + scrollTop >= scrollHeight) {
    6. // 检测到滚动至页面底部,进行后续操作
    7. // ...
    8. }
    9. }, false);