我在JavaScript中创建的图片幻灯片在本地工作正常,直到我在托管服务器上在线上传。我正在使用Go Daddy。任何人都可以帮助我吗?
var myIndex = 0;
carousel();
function carousel() {
var i;
var x = document.getElementsByClassName("mySlides");
for (i = 0; i < x.length; i++) {
x[i].style.display = "none";
}
myIndex++;
if (myIndex > x.length) {myIndex = 1}
x[myIndex-1].style.display = "block";
setTimeout(carousel, 2000);
}
<img class="mySlides" src="images/Carizmafront.jpg" alt="Carizma shop front"> <img class="mySlides" src="images/Carizmafront2.jpg" alt= "Carizma inside"> <img class="mySlides" src="images/Carizmafront3.jpg" alt= "Carizma inside"> <img class="mySlides" src="images/Carizmafront4.jpg" alt= "Carizma inside">