-
Notifications
You must be signed in to change notification settings - Fork 0
/
index11.js
78 lines (61 loc) · 1.43 KB
/
index11.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
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
// function myFunction() {
// var x = document.getElementById("myLinks");
// if (x.style.display === "block") {
// x.style.display = "none";
// } else {
// x.style.display = "block";
// }
// }
$('.owl-carousel').owlCarousel({
loop:true,
nav:false,
autoplay:false,
margin:-1,
autoplayTimeout: 4000,
stagePadding: 50,
responsive:{
0:{
items:1
},
320:{
items:1
},
1000:{
items:3
},
1400:{
items:3.5
}
}
})
let slideIndex = 1;
displaySlide(slideIndex);
function moveSlides(n) {
displaySlide(slideIndex += n);
}
function activeSlide(n) {
displaySlide(slideIndex = n);
}
/* Main function */
function displaySlide(n) {
let i;
let totalslides =
document.getElementsByClassName("slide");
let totaldots =
document.getElementsByClassName("footerdot");
if (n > totalslides.length) {
slideIndex = 1;
}
if (n < 1) {
slideIndex = totalslides.length;
}
for (i = 0; i < totalslides.length; i++) {
totalslides[i].style.display = "none";
}
for (i = 0; i < totaldots.length; i++) {
totaldots[i].className =
totaldots[i].className.replace(" active", "");
}
totalslides[slideIndex - 1].style.display = "block";
totaldots[slideIndex - 1].className += " active";
}