```
$(window).scroll(function() {
var scrollTop = $(this).scrollTop();
var scrollHeight = $(document).height();
var windowHeight = $(this).height();
if(scrollTop == 0){
alert('刷新逻辑,可以调用函数');
}
if(scrollTop + windowHeight == scrollHeight ){
alert('下拉到底了,加载更多的逻辑');
}
})
```