From e1f87858ad1b6255c215b7b856ded87f2dad1101 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?S=C3=A9bastien=20Lerique?= Date: Wed, 8 Feb 2017 15:08:33 +0100 Subject: [PATCH] Make the website nav header's hysteresis a bit more robust In particular, this prevents the nav header from reappearing all the time while scrolling down on Firefox. --- website/assets/js/main.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/website/assets/js/main.js b/website/assets/js/main.js index bd21f7995..ed2da747b 100644 --- a/website/assets/js/main.js +++ b/website/assets/js/main.js @@ -14,7 +14,7 @@ const updateNav = () => { const vh = updateVh() const newScrollY = (window.pageYOffset || document.scrollTop) - (document.clientTop || 0) - scrollUp = newScrollY <= scrollY + if (newScrollY != scrollY) scrollUp = newScrollY <= scrollY scrollY = newScrollY if(scrollUp && !(isNaN(scrollY) || scrollY <= vh)) nav.classList.add(fixedClass)