Refresh page not at top, header should be nestled up top
This commit is contained in:
parent
730362ac79
commit
bff6f85252
@ -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');
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user