Skip to content

Instantly share code, notes, and snippets.

@rnmp rnmp/
Created Sep 23, 2012

What would you like to do?

For more information about this project, follow this link.

// DATA-COLUMNS by Rolando Murillo (@rnmp)
// and Giorgio Leveroni (@ppold)
var grids = document.querySelectorAll('[data-columns]');
[], function(grid) {
var columns = grid.dataset.columns,
columnClass = '_col',
itemClass = '_item',
elements = [];
for (var i = columns - 1; i >= 0; --i) {
elements.forEach(function(columnElements) {
var column = document.createElement('div');
column.classList.add(columnClass);, function(element) {

This comment has been minimized.

Copy link
Owner Author

rnmp commented Oct 29, 2012

[].forEach is faster than Array.prototype.forEach according to:


This comment has been minimized.

Copy link

ppold commented Feb 21, 2013

Actually storing the forEach function in a variable is the fastest (using the same link you mentioned).

P.S. I'll implement the responsive support and the addition/deletion of content next week.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.