SHARE
TWEET

Untitled

a guest Jul 21st, 2019 61 Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. function hideNav(el, howMuch) {
  2.     var prevScrollpos = window.pageYOffset;
  3.  
  4.     window.addEventListener('scroll', function () {
  5.         var currentScrollPos = window.pageYOffset;
  6.         if (prevScrollpos > currentScrollPos) {
  7.  
  8.             el.style.transform = 'translateY(0%)'
  9.         } else {
  10.             el.style.transform = 'translateY(' + howMuch + '%)'
  11.         }
  12.         prevScrollpos = currentScrollPos;
  13.     });
  14. }
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
 
Top