Skip to content Skip to sidebar Skip to footer

Jquery: Trouble With Simple Slideshow

I'm having trouble with a super simple slideshow I'm trying to make. I can't figure out why it won't work. The first picture shows up but it does not cycle through. Here is the

Solution 1:

It is working now. I did lot of changes actually.

your updated fiddle

    setInterval(rotateImages, 2000);

function rotateImages()
{
var $onCurrent= $('#imageSlider div.current') ;
var $onNext= $onCurrent.next().length ? $onCurrent.next() : $('#imageSlider div:first');   

if (!$onNext.length )
    $onNext=$("#imageSlider div:first");

$("#imageSlider div").removeClass("current").css("opacity", 0);
$onNext.addClass('current').animate({opacity:1.0}, 1000);
}

Post a Comment for "Jquery: Trouble With Simple Slideshow"