Skip to content

Instantly share code, notes, and snippets.

@jongamble
Created March 1, 2013 14:48
Show Gist options
  • Save jongamble/5065114 to your computer and use it in GitHub Desktop.
Save jongamble/5065114 to your computer and use it in GitHub Desktop.
Minimal header slider
//Header image slider
function remCla( elemLen ){
$(".pager li").removeClass().eq(elemLen).addClass("active");
}
var i = 0;
function InOut( elem ){
elem.delay().fadeIn().delay(7000).fadeOut(800,
function(){
i+=1;
i%=3;
remCla(i);
if(elem.next().length > 0)
{InOut( elem.next() );}
else
{InOut( elem.siblings(':first'));}
}
);
}
$('.slider li').hide();
InOut( $('.slider li:first') );
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment