mirror of
https://github.com/explosion/spaCy.git
synced 2025-07-10 16:22:29 +03:00
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:
commit
c63bf3fc94
|
@ -14,7 +14,7 @@
|
||||||
const updateNav = () => {
|
const updateNav = () => {
|
||||||
const vh = updateVh()
|
const vh = updateVh()
|
||||||
const newScrollY = (window.pageYOffset || document.scrollTop) - (document.clientTop || 0)
|
const newScrollY = (window.pageYOffset || document.scrollTop) - (document.clientTop || 0)
|
||||||
scrollUp = newScrollY <= scrollY
|
if (newScrollY != scrollY) scrollUp = newScrollY <= scrollY
|
||||||
scrollY = newScrollY
|
scrollY = newScrollY
|
||||||
|
|
||||||
if(scrollUp && !(isNaN(scrollY) || scrollY <= vh)) nav.classList.add(fixedClass)
|
if(scrollUp && !(isNaN(scrollY) || scrollY <= vh)) nav.classList.add(fixedClass)
|
||||||
|
|
Loading…
Reference in New Issue
Block a user