Skip to content

Instantly share code, notes, and snippets.

@MiLk
Created August 22, 2011 13:28
Show Gist options
  • Save MiLk/1162375 to your computer and use it in GitHub Desktop.
Save MiLk/1162375 to your computer and use it in GitHub Desktop.
Slideshow
$("#slideshow .slide_control").click(function () {
slideshowSwitch();
});
setInterval('slideshowSwitch();',5000);
function slideshowSwitch() {
var next = $("#slideshow .active").next(".slide");
if($("#slideshow .active").hasClass("last"))
next = $("#slideshow .first");
$("#slideshow .active").animate({opacity:0},5000, function(){
$(this).removeClass("active");
next.animate({opacity:1},5000).addClass("active");
});
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment