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 JSFiddle: http://jsfiddle.net/cydonknight/kyhxy/
and the JQuery:
<script src="http://ajax.googleapis.com/ajax/libs/jquery/1.8.3/jquery.min.js"></script>
<script type="text/javascript">
$(document).ready(function(){
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");
$onCurrent.addClass('previous');
$onNext.css({opacity: 0.0}).addClass('current').animate({opacity:1.0}, 2000, function() {
$onCurrent.removeClass(' previous');
});
}
</script>
Any help would be greatly appreciated!