-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathv5.js
More file actions
23 lines (22 loc) · 678 Bytes
/
Copy pathv5.js
File metadata and controls
23 lines (22 loc) · 678 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
// state vars
let mobileNavShowing = false;
document.addEventListener("DOMContentLoaded", function () {
console.log("the dom has loaded!");
let mobileNavToggleButton = document.getElementById(
"toggle-mobile-nav-button"
);
let mobileNav = document.getElementById("mobile-nav");
console.log(mobileNavToggleButton);
console.log(mobileNav);
mobileNav.style.display = "none";
mobileNavToggleButton.addEventListener("click", () => {
if (mobileNavShowing) {
mobileNav.style.display = "none";
mobileNavShowing = false;
} else {
mobileNav.style.display = "block";
mobileNavShowing = true;
}
console.log("mobile nav showing: ", mobileNavShowing);
});
});