取消导航栏悬浮效果

This commit is contained in:
lwt
2026-05-09 10:45:14 +08:00
parent 56dea052d9
commit 4142cef39f
3 changed files with 1 additions and 15 deletions
-10
View File
@@ -1,15 +1,5 @@
const year = document.querySelector("#year");
const header = document.querySelector("[data-header]");
if (year) {
year.textContent = new Date().getFullYear();
}
if (header) {
const updateHeader = () => {
header.classList.toggle("is-scrolled", window.scrollY > 8);
};
updateHeader();
window.addEventListener("scroll", updateHeader, { passive: true });
}