var slideIndex = 0;
showSlides();
function showSlides()
{
var i;
var slides = document.getElementsByClassName("image-sliderfade");
var dots = document.getElementsByClassName("dot");
for (i = 0; i < slides.length; i++) {
// initially set the display to
// none for every image.
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", "");
}
slides[slideIndex - 1].style.display = "block";
dots[slideIndex - 1].className += " active";
setTimeout(showSlides, 2000);
}
i try this for auto slider but it gives this error: Uncaught SyntaxError: Unexpected token '(' or it tells that showSlides() is undefined(我为自动滑块尝试了此操作,但它给出了以下错误:未捕获的SyntaxError:意外的标记'('或它表明showSlides()未定义)
ask by sinandede translate from so
与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…