Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- var menu = false; //menu esta fechado
- document.getElementById('iddobotao').addEventListener("click", function(){
- if(menu){
- //menu está aberto
- closeNav();
- } else{
- openNav();
- }
- });
- function openNav() {
- document.getElementById("menusao").style.display = "inline";
- document.getElementById("nav").style.width = "100%"; // deixa isso definido no teu css usa o js só p mostrar e esconder
- menu = true;
- }
- function closeNav() {
- document.getElementById("menusao").style.display= "none";
- document.getElementById("open").style.display = "block";// deixa isso definido no teu css usa o js só p mostrar e esconder
- menu =false;
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement