Prevent scrolling background while foreground present
This commit is contained in:
parent
8428856d52
commit
6cfe52da8e
4 changed files with 21 additions and 2 deletions
|
|
@ -479,4 +479,8 @@ button:active {
|
|||
padding-left: 3rem;
|
||||
background-color: #404040;
|
||||
}
|
||||
|
||||
.no-scroll {
|
||||
overflow: hidden;
|
||||
}
|
||||
/*# sourceMappingURL=main.css.map */
|
||||
File diff suppressed because one or more lines are too long
|
|
@ -421,3 +421,6 @@ button {
|
|||
background-color: map-get($dark, "buttonActive");
|
||||
}
|
||||
}
|
||||
.no-scroll {
|
||||
overflow: hidden;
|
||||
}
|
||||
|
|
|
|||
|
|
@ -36,7 +36,19 @@ const toggleSubMenu = (el) => {
|
|||
};
|
||||
|
||||
const toggleMenu = () => {
|
||||
$(".mobile-menu").toggle("slide", "left");
|
||||
$(".mobile-menu").toggle("slide", "left", () => {
|
||||
|
||||
let visible = document.querySelector(".mobile-menu").style.display != "none";
|
||||
|
||||
if (visible) {
|
||||
document.body.classList.add("no-scroll");
|
||||
console.log("not visible");
|
||||
} else {
|
||||
document.body.classList.remove("no-scroll");
|
||||
console.log("visible");
|
||||
}
|
||||
});
|
||||
|
||||
};
|
||||
|
||||
$(document).ready(() => {
|
||||
|
|
|
|||
Loading…
Reference in a new issue