Account for pages not having a hero
Eg the homepage
This commit is contained in:
parent
6996e191e5
commit
1c9e1b4f74
1 changed files with 7 additions and 7 deletions
|
@ -91,9 +91,14 @@ window.addEventListener("load", () => {
|
||||||
});
|
});
|
||||||
|
|
||||||
window.addEventListener("DOMContentLoaded", () => {
|
window.addEventListener("DOMContentLoaded", () => {
|
||||||
|
if (HERO) {
|
||||||
setHeroHeight();
|
setHeroHeight();
|
||||||
handleHeroStuck();
|
handleHeroStuck();
|
||||||
|
|
||||||
|
window.addEventListener("resize", debounce(setHeroHeight, 2000));
|
||||||
|
window.addEventListener("scroll", throttle(handleHeroStuck, 100));
|
||||||
|
}
|
||||||
|
|
||||||
if (window.location.hash <= 1) {
|
if (window.location.hash <= 1) {
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
@ -111,8 +116,3 @@ window.addEventListener("DOMContentLoaded", () => {
|
||||||
|
|
||||||
scrollToElement(scrollTarget, "auto");
|
scrollToElement(scrollTarget, "auto");
|
||||||
});
|
});
|
||||||
|
|
||||||
if (HERO) {
|
|
||||||
window.addEventListener("resize", debounce(setHeroHeight, 2000));
|
|
||||||
window.addEventListener("scroll", throttle(handleHeroStuck, 100));
|
|
||||||
}
|
|
||||||
|
|
Loading…
Reference in a new issue