Skip to content

Instantly share code, notes, and snippets.

@mexitek
Last active December 19, 2015 03:19
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 mexitek/5889411 to your computer and use it in GitHub Desktop.
Save mexitek/5889411 to your computer and use it in GitHub Desktop.
A handlebars helper for displaying a block every x iterations of a loop.
Handlebars.registerHelper("everyOther", function (index, amount, scope) {
if ( ++index % amount )
return scope.inverse(this);
else
return scope.fn(this);
});
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment