-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathshared.js
More file actions
33 lines (25 loc) · 816 Bytes
/
Copy pathshared.js
File metadata and controls
33 lines (25 loc) · 816 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
// slideshow Logic
var slideIndex = 1;
showDivs(slideIndex);
function plusDivs(n) {
showDivs(slideIndex += n);
}
function currentDiv(n) {
showDivs(slideIndex = n);
}
function showDivs(n) {
var i;
var x = document.getElementsByClassName("slideshow_img");
var dots = document.getElementsByClassName("slideshow--controler_nav");
if (n > x.length) {slideIndex = 1}
if (n < 1) {slideIndex = x.length}
for (i = 0; i < x.length; i++) {
x[i].style.display = "none";
}
for (i = 0; i < dots.length; i++) {
dots[i].classList.remove("setWhiteBackground");
}
x[slideIndex-1].style.display = "block";
console.log(slideIndex);
dots[slideIndex-1].classList.add("setWhiteBackground");
}