the-glorious-startpage/js/centered-box.js
2020-06-04 14:13:46 +08:00

27 lines
574 B
JavaScript

var centeredBox = document.getElementById("centeredBox");
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');
}