You cannot select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and dots ('.'), can be up to 35 characters long. Letters must be lowercase.
21 lines
483 B
21 lines
483 B
let slideIndex = 1; |
|
showSlides(slideIndex); |
|
|
|
function plusSlides(n) { |
|
showSlides(slideIndex += n); |
|
} |
|
|
|
function currentSlide(n) { |
|
showSlides(slideIndex = n); |
|
} |
|
|
|
function showSlides(n) { |
|
let i; |
|
let slides = document.getElementsByClassName("ships-list"); |
|
if (n > slides.length) {slideIndex = 1} |
|
if (n < 1) {slideIndex = slides.length} |
|
for (i = 0; i < slides.length; i++) { |
|
slides[i].style.display = "none"; |
|
} |
|
slides[slideIndex-1].style.display = "block"; |
|
} |