Skip to content

Instantly share code, notes, and snippets.

@vladkras
Created May 2, 2013 00:13
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 vladkras/5499339 to your computer and use it in GitHub Desktop.
Save vladkras/5499339 to your computer and use it in GitHub Desktop.
eaSlyder - fast super lightweight jQuery based slider
(function( $ ) {
$.fn.eaSlyder = function( millisec ) {
var $this = this, total = $this.length, cur = 0, timeout = millisec || 4000;
this.each(function(index) {
if (index) $(this).hide();
});
setInterval(function() {
$this.eq(cur).fadeOut(function() {
cur = ( cur == total-1 ) ? 0 : cur+1;
$this.eq(cur).fadeIn();
});
}, timeout);
return this;
};
})(jQuery);
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment