Quantcast
Channel: Active questions tagged html - Stack Overflow
Viewing all articles
Browse latest Browse all 67527

Javascript slider not works

$
0
0
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


Viewing all articles
Browse latest Browse all 67527

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>