$(window).scroll(function() {
var scrollTop = $(this).scrollTop();
var scrollHeight = $(document).height();
var windowHeight = $(this).height();
if(scrollTop == 0){
alert(\'顶部\');
}
if(scrollTop + windowHeight == scrollHeight ){
alert(\'下拉到底了\');
}
})