-
Notifications
You must be signed in to change notification settings - Fork 0
/
index.js
38 lines (36 loc) · 1.47 KB
/
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
31
32
33
34
35
36
37
38
var MenuIcon=document.getElementById("MenuIcon");
var MobileNavBarActive=document.getElementById("MobileNavBarActive");
var HomeNav=document.getElementById("HomeNav");
var MobileHomeNav=document.getElementById("MobileHomeNav");
var MobileContactNav=document.getElementById("MobileContactNav");
var ContactNav=document.getElementById("ContactNav");
var CloseIcon=document.getElementById("CloseIcon");
MenuIcon.addEventListener('click',MobileNavActiveFn);
CloseIcon.addEventListener('click',MobileNavInactiveFn);
window.addEventListener('scroll',MobileNavInactiveFn);
HomeNav.addEventListener('click',HomeNavFn);
MobileHomeNav.addEventListener('click',HomeNavFn);
ContactNav.addEventListener('click',ContactNavFn);
MobileContactNav.addEventListener('click',ContactNavFn);
function HomeNavFn(){
MobileHomeNav.style.textDecoration="underline";
HomeNav.style.textDecoration="underline";
MobileContactNav.style.textDecoration="none";
ContactNav.style.textDecoration="none";
}
function ContactNavFn(){
MobileHomeNav.style.textDecoration="none";
HomeNav.style.textDecoration="none";
MobileContactNav.style.textDecoration="underline";
ContactNav.style.textDecoration="underline";
}
function MobileNavActiveFn(){
MobileNavBarActive.style.display="flex";
CloseIcon.style.display="flex";
MenuIcon.style.display="none";
}
function MobileNavInactiveFn(){
MobileNavBarActive.style.display="none";
CloseIcon.style.display="none";
MenuIcon.style.display="flex";
}