SHARE
TWEET

Untitled

a guest Mar 25th, 2019 62 Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. var nav = document.getElementById('nav'),
  2.     inner = document.getElementById('inner'),
  3.     height = inner.innerHeight,
  4.     scroll,
  5.     lastScroll = 0;
  6.  
  7. function navCheck() {
  8.   scroll = inner.scrollTop;
  9.  
  10.   if (scroll >= lastScroll) {
  11.     nav.className = 'fixed slide-up';
  12.   } else {
  13.     nav.className = 'fixed slide-down';
  14.   }
  15.  
  16.   lastScroll = scroll;
  17. }
  18.  
  19. inner.onscroll = navCheck;
RAW Paste Data
We use cookies for various purposes including analytics. By continuing to use Pastebin, you agree to our use of cookies as described in the Cookies Policy. OK, I Understand
Not a member of Pastebin yet?
Sign Up, it unlocks many cool features!
 
Top