index-website-static/assets/js/onload.js
Julie Blanc 162cee6dc9 base
2025-12-16 18:00:01 +01:00

23 lines
422 B
JavaScript

window.onload = function () {
includeHTML();
headerShrink();
};
window.onscroll = function () {
headerShrink();
};
function headerShrink() {
const header = document.getElementById('site-header');
const scrollPosition = window.scrollY || document.documentElement.scrollTop;
if (scrollPosition > 100) {
header.classList.add('is-shrinked');
} else {
header.classList.remove('is-shrinked');
}
}