-
Notifications
You must be signed in to change notification settings - Fork 6
/
script.js
57 lines (36 loc) · 1.53 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
54
55
56
57
let langBtn = document.getElementById('langBtn');
let langDrop = document.getElementById('langDrop');
let langSpan = document.getElementById('langSpan');
let langList = document.querySelectorAll('.langList');
langBtn.addEventListener('click', () => {
langDrop.classList.toggle("langDropShow");
})
langList.forEach(langList => langList.addEventListener('click', langSelectHandler));
function langSelectHandler(e){
langSpan.innerText = e.target.innerText;
langList.forEach((langList)=> langList.classList.remove("langActive"));
this.classList.add("langActive");
langDrop.classList.remove("langDropShow");
}
// accordion button starts
const accorDion = document.getElementsByClassName('accordionMain');
for(var i = 0; i < accorDion.length; i++){
accorDion[i].addEventListener('click', function(){
this.classList.toggle('accoShow');
});
}
let langBtn3 = document.getElementById('langBtn3');
let langDrop3 = document.getElementById('langDrop3');
let langSpan3 = document.getElementById('langSpan3');
let langList3 = document.querySelectorAll('.langList3');
langBtn3.addEventListener('click', () => {
langDrop3.classList.toggle("langDropShow3");
})
langList3.forEach(langList3 => langList3.addEventListener('click', langSelectHandler));
function langSelectHandler(elem){
langSpan3.innerText = elem.target.innerText;
langList3.forEach((langList3)=> langList3.classList.remove("langActive3"));
this.classList.add("langActive3");
langDrop3.classList.remove("langDropShow3");
}
// accordion button ends