I have a sidebar menu created with w3school. The issue is that until the page is fully loaded (including images and Adsense advertising), the Menu button does not react to clicks.
The javascript code I use is the basic one, inside head tags:
var openMenu = false;
function w3_open() {
if (openMenu) {
document.getElementById("mySidebar").style.display = "none";
openMenu = false;
} else {
document.getElementById("mySidebar").style.display = "block";
openMenu = true;
}
}
function w3_close() {
document.getElementById("mySidebar").style.display = "none";
openMenu = false;
}
<button class="w3-button w3-teal w3-xlarge w3-dark-gray" onclick="w3_open()">☰ Menu</button>
I need the menu to be clickable while the webpage is loading.