imprive centeredbox toggle

This commit is contained in:
Gerome Matilla 2020-06-04 14:13:46 +08:00
parent 6ab4ad3193
commit c041a059ac
2 changed files with 25 additions and 4 deletions

View File

@ -19,7 +19,7 @@
z-index var(--transition-speed);
}
#centeredBox.hiddenBox {
.hiddenBox {
opacity: 0 !important;
z-index: 0 !important;
}

View File

@ -1,6 +1,27 @@
var centeredBox = document.getElementById("centeredBox");
const toggleCenteredBox = () => {
centeredBox.classList.toggle('hiddenBox');
console.log('toggle center box');
let centeredBoxVisibility = true;
const showCenteredBox = () => {
centeredBox.classList.remove('hiddenBox');
centeredBoxVisibility = !centeredBoxVisibility;
}
const hideCenteredBox = () => {
centeredBox.classList.add('hiddenBox');
centeredBoxVisibility = !centeredBoxVisibility;
}
const toggleCenteredBox = () => {
if (centeredBoxVisibility) {
// Hide web menu
hideCenteredBox();
} else {
// Show Web menu
showCenteredBox();
}
console.log('toggle web menu');
}