'how to add setInterval for this function
how to make autoslide for this function with setinterval please help me with this question
$(document).ready(function() {
const next = document.querySelector(".next"),
back = document.querySelector(".back"),
slideshow = document.querySelector(".slideshow__images");
let angle = 0;
next.addEventListener("click", () => {
angle -= 45;
slideshow.style.transform = `translateZ(-25rem) rotateY(${angle}deg)`;
});
back.addEventListener("click", () => {
angle += 45;
slideshow.style.transform = `translateZ(-25rem) rotateY(${angle}deg)`;
});
});
Sources
This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.
Source: Stack Overflow
| Solution | Source |
|---|
