滚动条离底部的距离小于某个值

var winHeight = window.innerHeight ? window.innerHeight : $(window).height();
var scrollToBottomFlag = false;
    
$(window).scroll(function() {
    scrollToBottomFlag = ($(window).scrollTop() + winHeight > $(document).height() - 234);
    if (scrollToBottomFlag) {
        //滚动条离底部小于234 do something 
    }
})    

 

posted @ 2019-11-13 11:13  justsilky  阅读(367)  评论(0编辑  收藏  举报