Skip to content

Instantly share code, notes, and snippets.

@andrewle
Created January 7, 2010 12:08
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save andrewle/271193 to your computer and use it in GitHub Desktop.
Save andrewle/271193 to your computer and use it in GitHub Desktop.
function slideShow(elem) {
return (function () {
var next_elem = (elem.next().length > 0) ? elem.next() : $('#slide-images p:first');
elem.fadeOut(1000);
next_elem.fadeIn(1000);
setTimeout(slideShow(next_elem), 5000);
})
}
$(document).ready(function () {
if ($('#slide-images').length > 0) {
var elem = $('#slide-images p:first');
setTimeout(slideShow(elem), 4000);
}
});
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment