Last active
December 14, 2015 01:19
-
-
Save asjustas/5005274 to your computer and use it in GitHub Desktop.
recurse array function
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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