Skip to content

Instantly share code, notes, and snippets.

@daanl
Created June 5, 2013 07:27
Show Gist options
  • Save daanl/5712180 to your computer and use it in GitHub Desktop.
Save daanl/5712180 to your computer and use it in GitHub Desktop.
// async each non blocking
(function ($) {
$.fn.eachAsync = function (enumerable, callback) {
$.each(enumerable, function (index, element) {
var thisScope = this;
setTimeout(function() {
callback.apply(thisScope, [index, element]);
}, 100);
});
};
})(jQuery);
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment