Use position fixed for header animation; then position sticky once animation completes
This commit is contained in:
parent
172a35e27f
commit
9493b94691
2 changed files with 18 additions and 8 deletions
|
@ -9,10 +9,17 @@ window.addEventListener("DOMContentLoaded", () => {
|
|||
}
|
||||
siteHeader.classList.add("visible");
|
||||
|
||||
siteHeader.addEventListener("animationend", () => {
|
||||
console.log("Animation ended");
|
||||
siteHeader.classList.add("sticky");
|
||||
}, false);
|
||||
|
||||
try {
|
||||
const documentReferrer = new URL(document.referrer);
|
||||
if (documentReferrer.pathname === "/") {
|
||||
siteHeader.classList.add("animated");
|
||||
} else {
|
||||
siteHeader.classList.add("sticky");
|
||||
}
|
||||
} catch { }
|
||||
});
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue