-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathmain.js
33 lines (29 loc) · 927 Bytes
/
main.js
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
// Query elements
const navbarMenuOffcanvas = document.getElementById("navbar-menu-offcanvas");
const navbarMenuOffcanvasOpenBtn = document.getElementById(
"navbar-menu-offcanvas-open-btn"
);
const navbarMenuOffcanvasCloseBtn = document.getElementById(
"navbar-menu-offcanvas-close-btn"
);
const overlay = document.getElementById("overlay");
// Menu button clicked
navbarMenuOffcanvasOpenBtn.addEventListener("click", () => {
navbarMenuOffcanvas.classList.add("show");
overlay.classList.add("show");
});
// Close button clicked
navbarMenuOffcanvasCloseBtn.addEventListener("click", () => {
navbarMenuOffcanvas.classList.remove("show");
overlay.classList.remove("show");
});
// Overlay clicked
overlay.addEventListener("click", () => {
navbarMenuOffcanvas.classList.remove("show");
overlay.classList.remove("show");
});
function go(name)
{
console.log(name);
window.location.href = name.href + ".html";
}