fix(menu): dynamic overflow hidden on documentElement
All checks were successful
Deploy workflow / deploy (push) Successful in 29s

This commit is contained in:
Matthieu Bessat 2024-03-15 11:29:39 +01:00
parent 036c11ef5c
commit 6ba5bb0cf7

View file

@ -46,9 +46,11 @@
const nav_button = document.getElementById("navi-toggle")
nav_button.addEventListener("change", event => {
if (event.target.checked) {
document.documentElement.style.overflow = "hidden";
document.body.style.overflow = "hidden";
}
if (!event.target.checked) {
document.documentElement.overflow = "initial";
document.body.style.overflow = "initial";
}
})