Skip to content

Instantly share code, notes, and snippets.

@raybellis
Created October 15, 2012 12:05
Show Gist options
  • 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