Alpzy adlı üyeden alıntı: mesajı görüntüle
setInterval(plusDivs, 5000, 1)
Bu her 5000 milisaniyede (5 saniyede) bir plusDivs fonksiyonu 1 parametresi ile çağrılcaktır.
var slideIndex = 0;
carousel();

function plusDivs(n) {
carousel(slideIndex += n);
}

function carousel() {
var i;
var x = document.getElementsByClassName("mySlides");
for (i = 0; i < x.length; i++) {
x[i].style.display = "none";
}
slideIndex++;
if (slideIndex > x.length) {slideIndex = 1}
x[slideIndex-1].style.display = "block";
setTimeout(carousel, 10000); // Change image every 2 seconds
}
bu şekilde yaptım çalışıyor sorun yok, sağ yönde de ilerliyor ama geri olarak çalışmıyor..

<button class="w3-button w3-display-left w3-black" onclick="plusDivs(-1)">❮</button>
<button class="w3-button w3-display-right w3-black" onclick="plusDivs(1)">❯</button>