Advertisement
Guest User

Untitled

a guest
Jul 28th, 2016
64
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.29 KB | None | 0 0
  1.  
  2. var tempScrollTop, currentScrollTop = 0;
  3.  
  4. $(document).scroll(function(){
  5.  
  6. currentScrollTop = $(document).scrollTop();
  7.  
  8. if (tempScrollTop < currentScrollTop ){
  9. //scrolling down
  10. }
  11.  
  12. else if (tempScrollTop > currentScrollTop ){
  13. //scrolling up
  14.  
  15. }
  16.  
  17. tempScrollTop = currentScrollTop;
  18. });
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement