Skip to content

Commit

Permalink
Update script-main.js
Browse files Browse the repository at this point in the history
  • Loading branch information
neerajrekwar authored Oct 27, 2023
1 parent e86cbcd commit 4abc754
Showing 1 changed file with 13 additions and 6 deletions.
19 changes: 13 additions & 6 deletions script-main.js
Original file line number Diff line number Diff line change
Expand Up @@ -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",["..."])
// const insteadIAmOk = new Accepted("asal mein","ek tarfa",["..."])

0 comments on commit 4abc754

Please sign in to comment.