js滚动到底部事件

window.innerHeight表示窗口高度

$(document).height()返回文档高度

$(document).scrollTop()返回滚动条与顶部的距离,在最上部时为0,在最下部时为:$(document).height()-window.innerHeight

    $(document).scroll(
            function() {
                if ($(document).scrollTop() + window.innerHeight == $(document)
                        .height()) {
                    loadMore()
                }
            });
原文地址:https://www.cnblogs.com/weiyinfu/p/5514637.html