Make the navbar sticky effect smoother
This commit is contained in:
parent
470904c0a5
commit
39b86d4906
@ -67,7 +67,7 @@
|
||||
window.addEventListener("scroll", () => {
|
||||
const scrollPosition = window.scrollY || document.documentElement.scrollTop;
|
||||
const stickyLine = hero.scrollHeight - navbar.scrollHeight;
|
||||
if (scrollPosition > stickyLine) {
|
||||
if (scrollPosition > stickyLine + 55) {
|
||||
navbar.classList.add("nav--sticky");
|
||||
} else {
|
||||
navbar.classList.remove("nav--sticky");
|
||||
|
Loading…
x
Reference in New Issue
Block a user