1. 程式人生 > >JS監聽頁面滾動到底部事件

JS監聽頁面滾動到底部事件

his div span 頁面 == nbsp scroll win cnblogs

廢話不說,直接上代碼,放心我這個是最好的,直接放到js腳本裏,直接生效:

$(window).scroll(function(){
            var scrollTop = $(this).scrollTop();
            var scrollHeight = $(document).height();
            var windowHeight = $(this).height();
            if(scrollTop + windowHeight == scrollHeight){
                clickMore();
           }
      });

JS監聽頁面滾動到底部事件