Garrett Johnson
Garrett Johnson

Reputation: 113

Javascript slideshow is getting stuck

I am making a slideshow in Javascript and it is getting stuck on the second image. If you need more info let me know and ill post it. I really need this fixed.

http://jsfiddle.net/QURLC/1/

Javascript:

function slideShow() {
      var showing = $('#slideshow a');
      var next = showing.next().length ? showing.next() : showing.parent().children(':first');
      var timer;

    showing.fadeOut(500, function() { next.fadeIn(200).addClass('show'); }).removeClass('show');

    setTimeout(slideShow, 3500);  
}
$(document).ready(function(){
    slideShow();
});

Upvotes: 3

Views: 251

Answers (1)

Arman P.
Arman P.

Reputation: 4394

Here is updated and working demo

function slideShow() {

      var showing = $('#slideshow a.show');
      var next = showing.next().length ? showing.next() : showing.parent().children(':first');
      var timer;

      showing.fadeOut(500, function() { next.fadeIn(200).addClass('show'); }).removeClass('show');

      setTimeout(slideShow, 3500);

    }

Upvotes: 2

Related Questions