스크롤 내릴때와 올릴때 다른 이벤트를 적용하고 싶은데…헷갈려서 구글링 한결과 다음 같이 나왔다.

<script type='text/javascript'>
    $(function(){
      //Keep track of last scroll
      var lastScroll = 0;
      $(window).scroll(function(event){
          //Sets the current scroll position
          var st = $(this).scrollTop();
          //Determines up-or-down scrolling
          if (st > lastScroll){
             //Replace this with your function call for downward-scrolling
             alert("DOWN");
          }
          else {
             //Replace this with your function call for upward-scrolling
             alert("UP");
          }
          //Updates scroll position
          lastScroll = st;
      });
    });
</script>