-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathcarousell script.js
30 lines (27 loc) · 1.02 KB
/
carousell 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
// let slideIndex = 0;
// let videoEl;
// let timeout=7000;
// showSlides();
// function showSlides() {
// timeout = 7000;
// const slides = document.getElementsByClassName("mySlides");
// for (let i = 0; i < slides.length; i++) {
// slides[i].style.display = "none";
// if(slides[i].dataset.hasvideo === "1"){
// videoEl = document.getElementById(slides[i].dataset.videoid)
// videoEl.pause();
// }
// }
// slideIndex++;
// if (slideIndex > slides.length) {
// slideIndex = 1;
// }
// slides[slideIndex - 1].style.display = "block";
// if(slides[slideIndex - 1].dataset.hasvideo === "1"){
// videoEl = document.getElementById(slides[slideIndex - 1].dataset.videoid)
// console.log(videoEl);
// videoEl.play();
// timeout = videoEl.duration * 1000;
// }
// setTimeout(showSlides, timeout); // Change slide every 7 seconds
// }