Skip to content

Instantly share code, notes, and snippets.

@chestone
Created March 10, 2011 23:18
Show Gist options
  • Save chestone/865162 to your computer and use it in GitHub Desktop.
Save chestone/865162 to your computer and use it in GitHub Desktop.
Slideshow from Alex Korn.
setInterval(function(imgs, currIdx) {
return function() {
imgs[currIdx].style.display = 'none';
currIdx = (currIdx + 1 == imgs.length) ? 0 : currIdx + 1;
imgs[currIdx].style.display = '';
};
}(document.getElementById('slideshow').getElementsByTagName('span'), 0), 3000);
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment