diff --git a/src/stories/Blocks/header/header-sticky.js b/src/stories/Blocks/header/header-sticky.js index a7687337b..a679b57e0 100644 --- a/src/stories/Blocks/header/header-sticky.js +++ b/src/stories/Blocks/header/header-sticky.js @@ -26,14 +26,20 @@ window.addEventListener("DOMContentLoaded", () => { lastScrollY = scrollY > 0 ? scrollY : 0; // Control header direction class. + const headerContainerSelector = ".header"; + if (scrollDirection === "down") { - const headerHeight = document.querySelector("header").offsetHeight; + const headerHeight = document.querySelector( + headerContainerSelector + ).offsetHeight; const headerDownTopPosition = headerHeight + headerDownTopPositionOffset; document.querySelector( - "header" + headerContainerSelector ).style.top = `-${headerDownTopPosition}px`; } else { - document.querySelector("header").style.top = `${headerYStartPosition}px`; + document.querySelector( + headerContainerSelector + ).style.top = `${headerYStartPosition}px`; } }; diff --git a/src/styles/scss/shared.scss b/src/styles/scss/shared.scss index f4bed8c4c..c7d837851 100644 --- a/src/styles/scss/shared.scss +++ b/src/styles/scss/shared.scss @@ -48,6 +48,10 @@ cursor: pointer; } +.overflow-hidden { + overflow: hidden; +} + // When class is used on a block element it will show a loading ellipsis animation. .text-loading:after { overflow: hidden;