diff --git a/script-main.js b/script-main.js index d0b4b62..4267944 100644 --- a/script-main.js +++ b/script-main.js @@ -10,11 +10,18 @@ function screen() { document.getElementById("screen-fit").innerHTML = 'Screen: ' + myWidth + "x" + myHeight + ' px'; } */ -let menu = document.querySelector('#menu-icon'); -let navbar = document.querySelector('.navbar'); +const buttonThree = document.querySelector('.button-three'); + +buttonThree.addEventListener('click', () => { + const menu = document.querySelector('.navbar'); + menu.classList.toggle('active'); + const isOpened = buttonThree.getAttribute('aria-expanded'); + if (isOpened === 'false') { + buttonThree.setAttribute('aria-expanded', 'true'); + } else { + buttonThree.setAttribute('aria-expanded', 'false'); + } +}) -menu.onclick = () => { - menu.classList.toggle('bx-x'); - navbar.classList.toggle('open'); } -// const insteadIAmOk = new Accepted("asal mein","ek tarfa",["..."]) \ No newline at end of file +// const insteadIAmOk = new Accepted("asal mein","ek tarfa",["..."])