-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathscript.js
53 lines (42 loc) · 1.92 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
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
function products(){
document.getElementById("productDropdown").classList.toggle("show");
if(document.getElementById("arrow-1").style.transform == "rotate(180deg)"){
document.getElementById("arrow-1").style.transform = "rotate(0deg)"
}else{
document.getElementById("arrow-1").style.transform = "rotate(180deg)";
}
}
function company(){
document.getElementById("companyDropdown").classList.toggle("show");
if(document.getElementById("arrow-2").style.transform == "rotate(180deg)"){
document.getElementById("arrow-2").style.transform = "rotate(0deg)"
}else{
document.getElementById("arrow-2").style.transform = "rotate(180deg)";
}
}
function connect(){
document.getElementById("connectDropdown").classList.toggle("show");
if(document.getElementById("arrow-3").style.transform == "rotate(180deg)"){
document.getElementById("arrow-3").style.transform = "rotate(0deg)"
}else{
document.getElementById("arrow-3").style.transform = "rotate(180deg)";
}
}
window.onclick = function(event) {
if (!event.target.matches('.product-btn') ) {
if(document.getElementById("productDropdown").classList.contains('show')){
document.getElementById("productDropdown").classList.remove('show');
document.getElementById("arrow-1").style.transform = "rotate(0deg)";
}
}
if (!event.target.matches('.company-btn') ) {
if(document.getElementById("companyDropdown").classList.contains('show')){
document.getElementById("companyDropdown").classList.remove('show');
}
}
if (!event.target.matches('.connect-btn') ) {
if(document.getElementById("connectDropdown").classList.contains('show')){
document.getElementById("connectDropdown").classList.remove('show');
}
}
}