Skip to content

Instantly share code, notes, and snippets.

@asjustas
Last active December 14, 2015 01:19
Show Gist options
  • Save asjustas/5005274 to your computer and use it in GitHub Desktop.
Save asjustas/5005274 to your computer and use it in GitHub Desktop.
recurse array function
recurse_func = function(arr, callback, delay) {
if (typeof(callback) == "function") {
delay = delay || 200;
var self = arr, idx = 0;
setInterval(function() {
callback(self[idx], idx);
idx = (idx+1 < self.length) ? idx+1 : 0;
}, delay);
}
}
recurse_func(tools_arr, function(item, index){
$('.other_tools_tool').fadeOut('slow', function(){
$('.other_tools_tool').html(item).fadeIn('slow');
});
} ,3000);
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment