Skip to content

Instantly share code, notes, and snippets.

@crittermike
Created August 9, 2010 18:19
Show Gist options
  • Save crittermike/515851 to your computer and use it in GitHub Desktop.
Save crittermike/515851 to your computer and use it in GitHub Desktop.
jQuery.fn.slowEach = function( interval, callback ) {
var array = this;
if( ! array.length ) return;
var i = 0;
next();
function next() {
if( callback.call( array[i], i, array[i] ) !== false )
if( ++i < array.length )
setTimeout( next, interval );
}
};
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment