Skip to content

Instantly share code, notes, and snippets.

@raybellis
Created October 15, 2012 12:05
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save raybellis/3892123 to your computer and use it in GitHub Desktop.
Save raybellis/3892123 to your computer and use it in GitHub Desktop.
jQuery loop plugin
(function($) {
$.loop = function(n, cb, ctx) {
for (var i = 0; i < n; ++i) {
if (cb.call(ctx, i) === false) break;
}
};
})(jQuery);
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment