Skip to content

Instantly share code, notes, and snippets.

@zenlor
Created June 17, 2011 08:49
Show Gist options
  • Select an option

  • Save zenlor/1031087 to your computer and use it in GitHub Desktop.

Select an option

Save zenlor/1031087 to your computer and use it in GitHub Desktop.
/* settings */
var showDuration = 6000,
container = $('#yoga_wrapper'),
images = container.find('img').css({"opacity":"0"}),
currentIndex = 0;
/* worker */
var show = function() {
$(images[currentIndex]).animate({"opacity":0});
$(images[currentIndex = currentIndex < images.length - 1 ? currentIndex + 1 : 0]).animate({"opacity":1});
};
window.setInterval(show, showDuration);
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment