title: Always show nav unless scroll beyond certain point
body: <p>I want my nav bar to always show unless the user reaches a certain point down the page, then I'd like it to hide. I have the hide on scroll but can't think of how to always show until it reach a certain point. Thanks for any input.</p>
  <pre><code>var prevScrollpos = window.pageYOffset;
  window.onscroll = function() {
    var currentScrollPos = window.pageYOffset;
    if (prevScrollpos &gt; currentScrollPos) {
      document.getElementById(&quot;whole-nav&quot;).style.top = &quot;0&quot;;
    } else {
      document.getElementById(&quot;whole-nav&quot;).style.top = &quot;-80px&quot;;
    }
    prevScrollpos = currentScrollPos;
  } 
  </code></pre>