-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathscript2.js
More file actions
34 lines (30 loc) · 903 Bytes
/
script2.js
File metadata and controls
34 lines (30 loc) · 903 Bytes
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
const btnclient = document.getElementsByClassName("btn-client");
const slide = document.getElementById("slide");
btnclient[0].onclick = function () {
slide.style.transform = "translateX(0px)";
for (i = 0; i < 4; i++) {
btnclient[i].classList.remove("active");
}
this.classList.add("active");
};
btnclient[1].onclick = function () {
slide.style.transform = "translateX(-800px)";
for (i = 0; i < 4; i++) {
btnclient[i].classList.remove("active");
}
this.classList.add("active");
};
btnclient[2].onclick = function () {
slide.style.transform = "translateX(-1600px)";
for (i = 0; i < 4; i++) {
btnclient[i].classList.remove("active");
}
this.classList.add("active");
};
btnclient[3].onclick = function () {
slide.style.transform = "translateX(-2400px)";
for (i = 0; i < 4; i++) {
btnclient[i].classList.remove("active");
}
this.classList.add("active");
};