废话不多说,直接上代码 $(window).scroll(function(){ var before = $(window).scrollTop(); $(window).scroll(function() { var after = $(window).scrollTop(); if (before<after) { console.log('上'); before = after; }; if (before>after) { console.log('下'); before = aft…
var t = 0, b = 0; $(window).scroll(function(){ t = $(this).scrollTop(); if(b < t){ console.log('向下滚动中...') }else{ console.log('向上滚动中...') } setTimeout(function(){ b = t }, 0) })…