-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathnav-dropdown.js
108 lines (82 loc) · 3.87 KB
/
nav-dropdown.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
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
'use strict'
const nav_mainPage = document.getElementsByClassName('nav-mainPage');
const nav_catPage = document.getElementsByClassName('nav-catalogPage');
const nav_commPage = document.getElementsByClassName('nav-commPage');
const nav_resPage = document.getElementsByClassName('nav-resPage');
const nav_priPage = document.getElementsByClassName('nav-priPage');
var scrollbar = window.scrollY;
if (scrollbar > 20) {
document.getElementsByClassName('mob-nav')[0].style.background = "#FFF";
document.getElementsByClassName('mob-nav')[0].style.color = "#1A191D";
document.getElementsByClassName('mob-nav-frame-right')[0].style.filer = "invert(100%)";
document.getElementsByClassName('nav-bar-desktop')[0].style.background = "#FFF";
document.getElementsByClassName('nav-bar-desktop')[0].style.color = "#121212";
}
else {
document.getElementsByClassName('nav-bar-desktop')[0].style.background = "#1A191D";
document.getElementsByClassName('nav-bar-desktop')[0].style.color = "#FFF";
document.getElementsByClassName('mob-nav')[0].style.background = "#1A191D";
document.getElementsByClassName('mob-nav')[0].style.color = "#fff";
document.getElementsByClassName('mob-nav-frame-right')[0].style.filter = "invert(0%)";
}
function hideMobNavigationMenu() {
document.querySelector('body').style.overflow="scroll"
nav_commPage[0].style.display = "none";
nav_catPage[0].style.display = "none";
nav_mainPage[0].style.display = "none";
nav_resPage[0].style.display = "none";
nav_priPage[0].style.display = "none";
}
function showMobMainNavigationMenu() {
document.querySelector('body').style.overflow="hidden"
nav_commPage[0].style.display = "none";
nav_catPage[0].style.display = "none";
nav_mainPage[0].style.display = "block";
nav_resPage[0].style.display = "none";
nav_priPage[0].style.display = "none";
}
function showMobCatNavigationMenu() {
nav_commPage[0].style.display = "none";
nav_catPage[0].style.display = "block";
nav_mainPage[0].style.display = "block";
nav_resPage[0].style.display = "none";
nav_priPage[0].style.display = "none";
}
function showMobCommNavigationMenu() {
nav_commPage[0].style.display = "block";
nav_catPage[0].style.display = "none";
nav_mainPage[0].style.display = "block";
nav_resPage[0].style.display = "none";
nav_priPage[0].style.display = "none";
}
function showMobResNavigationMenu() {
nav_commPage[0].style.display = "res";
nav_catPage[0].style.display = "none";
nav_mainPage[0].style.display = "block";
nav_resPage[0].style.display = "block";
nav_priPage[0].style.display = "none";
}
function showMobPriNavigationMenu() {
nav_commPage[0].style.display = "none";
nav_catPage[0].style.display = "none";
nav_mainPage[0].style.display = "block";
nav_resPage[0].style.display = "none";
nav_priPage[0].style.display = "block";
}
window.addEventListener('scroll', function (event) {
var scrollbar = window.scrollY;
if (scrollbar > 20) {
document.getElementsByClassName('mob-nav')[0].style.background = "#FFF";
document.getElementsByClassName('mob-nav')[0].style.color = "#1A191D";
document.getElementsByClassName('mob-nav-frame-right')[0].style.filter = "invert(100%)";
document.getElementsByClassName('nav-bar-desktop')[0].style.background = "#FFF";
document.getElementsByClassName('nav-bar-desktop')[0].style.color = "#121212";
}
else {
document.getElementsByClassName('nav-bar-desktop')[0].style.background = "#1A191D";
document.getElementsByClassName('nav-bar-desktop')[0].style.color = "#FFF";
document.getElementsByClassName('mob-nav-frame-right')[0].style.filter = "invert(0%)";
document.getElementsByClassName('mob-nav')[0].style.background = "#1A191D";
document.getElementsByClassName('mob-nav')[0].style.color = "#fff";
}
});