Created
August 22, 2011 13:28
-
-
Save MiLk/1162375 to your computer and use it in GitHub Desktop.
Slideshow
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
$("#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