-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathindex.js
30 lines (27 loc) · 966 Bytes
/
index.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
let menuArray = [[false, "about"], [false, "projects"]]
function menuArrayFalseAll() {
for (let index = 0; index < menuArray.length; index++) {
document.getElementById(menuArray[index][1]).style.display = "none";
menuArray[index][0] = false;
}
}
function mostrarAbout() {
if (menuArray[0][0] == false) {
menuArrayFalseAll();
document.getElementById("about").style.display = "block";
menuArray[0][0] = true;
} else if (menuArray[0][0] == true) {
document.getElementById("about").style.display = "none";
menuArray[0][0] = false;
}
}
function mostrarProjects() {
if (menuArray[1][0] == false) {
menuArrayFalseAll();
document.getElementById("projects").style.display = "block";
menuArray[1][0] = true;
} else if (menuArray[1][0] == true) {
document.getElementById("projects").style.display = "none";
menuArray[1][0] = false;
}
}