Skip to content

Instantly share code, notes, and snippets.

@koentjuh1
Created August 30, 2016 09:15
Show Gist options
  • Save koentjuh1/cb08616e7f014474f0503ca19a2aa85a to your computer and use it in GitHub Desktop.
Save koentjuh1/cb08616e7f014474f0503ca19a2aa85a to your computer and use it in GitHub Desktop.
product list line
$(".item-list .item").each( function (index) {
index += 1;
// als er 4 items zijn voeg html toe.
if(index % 4 === 0) {
$(this).after('<div class="col-xs-12 line line-3"></div>');
}
// als er 3 items zijn voeg html toe.
if(index % 3 === 0) {
$(this).after('<div class="col-xs-12 line line-3"></div>');
}
// als er 2 items zijn voeg html toe.
if(index % 2 === 0) {
$(this).after('<div class="col-xs-12 line line-2"></div>');
}
});
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment