-
Notifications
You must be signed in to change notification settings - Fork 0
/
slickMulti.js
23 lines (20 loc) · 903 Bytes
/
slickMulti.js
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
// https://colorlib.com/preview/theme/seogo/
const buttonsWrapper = document.querySelector(".map");
const slides = document.querySelector(".inner");
buttonsWrapper.addEventListener("click", e => {
if (e.target.nodeName === "BUTTON") {
Array.from(buttonsWrapper.children).forEach(item =>
item.classList.remove("active")
);
if (e.target.classList.contains("first")) {
slides.style.transform = "translateX(-0%)";
e.target.classList.add("active");
} else if (e.target.classList.contains("second")) {
slides.style.transform = "translateX(-33.33333333333333%)";
e.target.classList.add("active");
} else if (e.target.classList.contains('third')) {
slides.style.transform = 'translatex(-66.6666666667%)';
e.target.classList.add('active');
}
}
});