Skip to content

Instantly share code, notes, and snippets.

Embed
What would you like to do?
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