title: Can i use a percentage as a value in scrolltop?
body: <p>I'm pretty new to HTML in general. I have the following code and I was wondering if there is any way of using a percentage instead of a fixed value. I have searched but I couldn't find a simple solution.</p>
  
  <pre><code>$(window).scroll(function () { 
      if ($(this).scrollTop() &gt; 445 &amp;&amp; $(this).scrollTop() &lt; 1425 ) { 
          nav.addClass("f-nav");
      } else { 
          nav.removeClass("f-nav");
      } 
  </code></pre>
  
  <p>Basically what I want is the class to be removed after scrolling past 80% of the page, instead of after 1425px so that it also works properly if the window size is modified.</p>