Declare navbar variable

This commit is contained in:
Leilukin 2024-04-12 00:45:54 +08:00 committed by Helen Chong
parent 7ac7d67f5f
commit e11d645d5c

View File

@ -64,7 +64,7 @@
// Make the navigation bar sticky
// const header = document.querySelector(".main-header");
// const navbar = document.querySelector("navbar");
const navbar = document.querySelector("navbar");
window.addEventListener("scroll", e => {
const scrollPos = window.scrollY || document.documentElement.scrollTop;
const stickyLine = document.querySelector(".main-header").scrollHeight - navbar.scrollHeight;