diff --git a/assets/js/st-nav.js b/assets/js/st-nav.js index d672d83..4cb4131 100644 --- a/assets/js/st-nav.js +++ b/assets/js/st-nav.js @@ -38,6 +38,14 @@ let lastScrollPosition = 0; const scrollDepthActivationPoint = 80; window.addEventListener('scroll', function(event) { + setHeaderClasses() +}); + +window.addEventListener('load', function(event) { + setHeaderClasses() +}) + +function setHeaderClasses() { const scrollPosition = window.scrollY; if(scrollPosition < scrollDepthActivationPoint) { @@ -59,7 +67,7 @@ window.addEventListener('scroll', function(event) { } lastScrollPosition = scrollPosition; -}); +} const navItems = document.querySelectorAll('.st-header-icon-bar__item');