Skip to content

Instantly share code, notes, and snippets.

@webcracy
Created October 4, 2011 13:00
Show Gist options
  • Save webcracy/1261588 to your computer and use it in GitHub Desktop.
Save webcracy/1261588 to your computer and use it in GitHub Desktop.
Dead simple JS / jquery slideshow
$('.slide').each(function() {
$(this).hide();
});
(function shownext(jq){
jq.eq(0).fadeIn(500, function(){
$(this).delay(5500).fadeOut(250, function() {
if ((jq=jq.slice(1)).length == 0)
(jq=$('.slide')).length && shownext(jq);
else
shownext(jq);
});;
});
})($('.slide'))
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment