Declare navbar variable
This commit is contained in:
parent
b2481e8e0b
commit
6b3279642d
|
@ -64,7 +64,7 @@
|
||||||
// Make the navigation bar sticky
|
// Make the navigation bar sticky
|
||||||
|
|
||||||
// const header = document.querySelector(".main-header");
|
// const header = document.querySelector(".main-header");
|
||||||
// const navbar = document.querySelector("navbar");
|
const navbar = document.querySelector("navbar");
|
||||||
window.addEventListener("scroll", e => {
|
window.addEventListener("scroll", e => {
|
||||||
const scrollPos = window.scrollY || document.documentElement.scrollTop;
|
const scrollPos = window.scrollY || document.documentElement.scrollTop;
|
||||||
const stickyLine = document.querySelector(".main-header").scrollHeight - navbar.scrollHeight;
|
const stickyLine = document.querySelector(".main-header").scrollHeight - navbar.scrollHeight;
|
||||||
|
|
Loading…
Reference in New Issue