-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathmobilemenu.js
47 lines (42 loc) · 1.66 KB
/
mobilemenu.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
34
35
36
37
38
39
40
41
42
43
44
45
46
47
const hamburger = document.querySelector(".hamburger");
const nav = document.querySelector(".m-nav");
const logo = document.querySelector(".logo");
hamburger.addEventListener("click", () => {
hamburger.classList.toggle("clicked");
nav.classList.toggle("show");
logo.classList.toggle("hide");
});
// var acc = document.getElementsByClassName("mobile-main-menu");
// var i;
// for (i = 0; i < acc.length; i++) {
// acc[i].addEventListener("click", function() {
// this.classList.toggle("active");
// var mobilesubmenu = this.nextElementSibling;
// if (mobilesubmenu.style.minHeight) {
// mobilesubmenu.style.minHeight = null;
// } else {
// mobilesubmenu.style.minHeight = mobilesubmenu.scrollHeight + "px";
// }
// });
// }
// var acc = document.getElementsByClassName("mobile-about-submenu");
// var i;
// for (i = 0; i < acc.length; i++) {
// acc[i].addEventListener("click", function() {
// this.classList.toggle("sactive");
// var mobilesubsubmenu = this.nextElementSibling;
// if (mobilesubsubmenu.style.maxHeight) {
// mobilesubsubmenu.style.maxHeight = null;
// // mobilesubsubmenu.style.fontSize = null;
// // mobilesubsubmenu.style.marginTop = null;
// // mobilesubsubmenu.style.overflow = "hidden";
// // mobilesubsubmenu.style.lineHeight = null;
// } else {
// mobilesubsubmenu.style.maxHeight = mobilesubsubmenu.scrollHeight + "px";
// // mobilesubsubmenu.style.fontSize = 8 + "px";
// // mobilesubsubmenu.style.marginTop = -5 + "px";
// // mobilesubsubmenu.style.overflow = "visible";
// // mobilesubsubmenu.style.lineHeight = 10 + "px";
// }
// });
// }