B
B
BulbaZaRRR2021-07-09 02:01:14
JavaScript
BulbaZaRRR, 2021-07-09 02:01:14

How to change slideshow animation?

There is this html code, with js script. Everything works well, but the slide transition animation is too sharp.. Please help, how to make the animation smooth, what would be from left to right?
60e784ad6b2fd620334071.png

function showSlides() {
var i;
var slides = document.getElementsByClassName("mySlides");
var dots = document.getElementsByClassName("dot");
for (i = 0; i < slides.length; i++) {
slides[i].style.display = "none";
}
slideIndex++;
if (slideIndex > slides.length) {slideIndex = 1}
for (i = 0; i < dots.length; i++) {
dots[i].className = dots[i].className.replace(" active", "" );
dots[slideIndex-1].className += "active";
setTimeout(showSlides, 5000); // Change image every 2 seconds

}

Answer the question

In order to leave comments, you need to log in

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question