var lastScrollTop = 0,
scrollDirection = 0;
$(window).scroll(function(event){
var st = $(this).scrollTop();
if (st > lastScrollTop){
scrollDirection = 1;
} else {
scrollDirection = 2;
}
lastScrollTop = st;
});
console.log(scrollDirection);
var lastScrollTop = 0,
scrollDirection = 0;
$(window).scroll(function(event){
var st = $(this).scrollTop();
if (st > lastScrollTop){
scrollDirection = 1;
} else {
scrollDirection = 2;
}
lastScrollTop = st;
console.log(scrollDirection);
});