Reputation: 113
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.
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
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