取消导航栏悬浮效果
This commit is contained in:
@@ -7,9 +7,6 @@
|
||||
}
|
||||
|
||||
.site-header {
|
||||
position: sticky;
|
||||
top: 16px;
|
||||
z-index: 20;
|
||||
display: grid;
|
||||
grid-template-columns: auto 1fr auto;
|
||||
gap: 26px;
|
||||
@@ -101,7 +98,6 @@
|
||||
}
|
||||
|
||||
.site-header {
|
||||
top: 10px;
|
||||
border-radius: 18px;
|
||||
}
|
||||
|
||||
|
||||
@@ -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 });
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user