-
Notifications
You must be signed in to change notification settings - Fork 0
/
script.js
34 lines (29 loc) · 1.19 KB
/
script.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
function myFunction() {
var x = document.getElementById("myTopnav");
if (x.className === "topnav") {
x.className += " responsive";
} else {
x.className = "topnav";
}
}
const homebtn = document.getElementById("homebtn");
const projbtn = document.getElementById("projbtn");
const contbtn = document.getElementById("contbtn");
homebtn.addEventListener("click", myFunction1);
projbtn.addEventListener("click", myFunction2);
contbtn.addEventListener("click", myFunction3);
function myFunction1() {
document.getElementById("projbtn").style.backgroundColor = '#333';
document.getElementById("homebtn").style.backgroundColor = '#04AA6D';
document.getElementById("contbtn").style.backgroundColor = '#333';
}
function myFunction2() {
document.getElementById("projbtn").style.backgroundColor = '#04AA6D';
document.getElementById("homebtn").style.backgroundColor = '#333';
document.getElementById("contbtn").style.backgroundColor = '#333';
}
function myFunction3() {
document.getElementById("projbtn").style.backgroundColor = '#333';
document.getElementById("homebtn").style.backgroundColor = '#333';
document.getElementById("contbtn").style.backgroundColor = '#04AA6D';
}