Quoted By:
I'm trying to make a simple "hamburger menu" on my website. When you click the burger icon, a menu pops up, and it goes away when you either click the burger or anywhere else outside the menu.
It works except for one part. Once the menu is open, I can't close it by pressing the same burger button again. There's some logical conflict here that I'm too dumb to detect.
The part that doesn't work is this:
>if(menu.style.display == "block") {
>menu.style.display = "none";
>}
Menu means the actual pop-up menu, menubtn is the burgerbutton that opens up the menu.
Another issue: this won't work on my cellphone, only computer. I'm not a JS guy
It works except for one part. Once the menu is open, I can't close it by pressing the same burger button again. There's some logical conflict here that I'm too dumb to detect.
The part that doesn't work is this:
>if(menu.style.display == "block") {
>menu.style.display = "none";
>}
Menu means the actual pop-up menu, menubtn is the burgerbutton that opens up the menu.
Another issue: this won't work on my cellphone, only computer. I'm not a JS guy