Caricamento template
This commit is contained in:
11
js/script.js
Normal file
11
js/script.js
Normal file
@@ -0,0 +1,11 @@
|
||||
function scrollHeader() {
|
||||
const h = document.getElementById("header");
|
||||
if (window.scrollY > 0) {
|
||||
h.classList.add("fixed");
|
||||
} else {
|
||||
h.classList.remove("fixed");
|
||||
}
|
||||
}
|
||||
|
||||
window.addEventListener("scroll", scrollHeader);
|
||||
window.addEventListener("load", scrollHeader);
|
||||
Reference in New Issue
Block a user