Merge pull request #814 from wehlutyk/website-nav-hysteresis

Make the website nav header's hysteresis a bit more robust
This commit is contained in:
Ines Montani 2017-02-08 21:30:34 +01:00 committed by GitHub
commit c63bf3fc94

View File

@ -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)