mirror of
https://github.com/explosion/spaCy.git
synced 2024-12-24 00:46:28 +03:00
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.
This commit is contained in:
parent
8ac741c217
commit
e1f87858ad
|
@ -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)
|
||||
|
|
Loading…
Reference in New Issue
Block a user