fix(menu): dynamic overflow hidden on documentElement
This commit is contained in:
parent
c4b6950a07
commit
86d9107d59
1 changed files with 2 additions and 0 deletions
|
@ -46,9 +46,11 @@
|
||||||
const nav_button = document.getElementById("navi-toggle")
|
const nav_button = document.getElementById("navi-toggle")
|
||||||
nav_button.addEventListener("change", event => {
|
nav_button.addEventListener("change", event => {
|
||||||
if (event.target.checked) {
|
if (event.target.checked) {
|
||||||
|
document.documentElement.style.overflow = "hidden";
|
||||||
document.body.style.overflow = "hidden";
|
document.body.style.overflow = "hidden";
|
||||||
}
|
}
|
||||||
if (!event.target.checked) {
|
if (!event.target.checked) {
|
||||||
|
document.documentElement.overflow = "initial";
|
||||||
document.body.style.overflow = "initial";
|
document.body.style.overflow = "initial";
|
||||||
}
|
}
|
||||||
})
|
})
|
||||||
|
|
Loading…
Reference in a new issue