Each if statement contains specific numbers to change the text color of the visited/current/active anchor link. The height of the page is dependent on its width. How can this be resolved? Apologies if my explanation is confusing, English isn't my strongest language XD
var bottomPage = $(window).scrollTop() + $(window).height() == $(document).height();
var scrollPos = $(window).scrollTop();
if(scrollPos >= 300 && scrollPos <= 854){
$('header nav ul li a').removeClass();
$('header nav ul li a[href="#about-nav"]').addClass('current');
}else if (scrollPos >= 855 && !bottomPage){
$('header nav ul li a').removeClass();
$('header nav ul li a[href="#portfolio-scroll"]').addClass('current');
}else if (bottomPage){
$('header nav ul li a').removeClass();
$('header nav ul li a[href="#contact-scroll"]').addClass('current');
}else {
$('header nav ul li a').removeClass();
}