Created
October 27, 2012 10:49
-
-
Save PerpetualBeta/3964231 to your computer and use it in GitHub Desktop.
Cycle through a series of images. Fade transition between slides. Loops back to first slide at end of collection.
This file contains hidden or 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
// Requires the jQuery library - http://jquery.com/ | |
// Demo: http://jsfiddle.net/DarkBlue/zM3A2/3/embedded/result/ | |
function slideshow(){var a=$("#animation img.active");a.length==0&&(a=$("#animation img:last"));var b=a.next().length?a.next():$("#animation img:first");a.addClass("last-active");b.css({opacity:0}).addClass("active").animate({opacity:1},1E3,function(){a.removeClass("active last-active")})}$(function(){setInterval("slideshow()",5E3)}); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Demo: http://jsfiddle.net/DarkBlue/zM3A2/3/embedded/result/