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.
$(window).scroll(function () {
if ($(this).scrollTop() > 445 && $(this).scrollTop() < 1425 ) {
nav.addClass("f-nav");
} else {
nav.removeClass("f-nav");
}
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.