From 213d5bcab462a668fbe610aec64ef804277a331d Mon Sep 17 00:00:00 2001 From: alistair3149 Date: Mon, 28 Oct 2019 17:46:50 -0400 Subject: [PATCH] Fix hover header --- resources/scripts/header.js | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/resources/scripts/header.js b/resources/scripts/header.js index c6cc6014..980becd0 100644 --- a/resources/scripts/header.js +++ b/resources/scripts/header.js @@ -28,13 +28,13 @@ function hasScrolled() { if (Math.abs(lastScrollTop - st) <= delta) return; - // If scrolled down and past the navbar, add class .nav-up. - if (st > lastScrollTop && st > navbarHeight) { + // Remove class when header is back in place + if (document.scrollTop == 0) { + $('header').removeClass('nav-down') + } else if (st > lastScrollTop && st > navbarHeight) { + // If scrolled down and past the navbar, add class .nav-up. // Scroll Down $('header').removeClass('nav-down').addClass('nav-up'); - } else if (document.scrollTop == 0) { - // Remove class when header is back in place - $('header').removeClass('nav-down') } else { // Scroll Up if (st + $(window).height() < $(document).height()) {