Skip to content

Instantly share code, notes, and snippets.

@zearadoua

zearadoua/js

Created Nov 3, 2017
Embed
What would you like to do?
insert every 3 column inside a row
fixColHeight = function () {
if ($('.page-search.page-search-node').length) {
var $container = $(".node-search-results");
var $cols = $container.find(".row > div").detach();
$container.empty();
for(var i = 0; i < $cols.length; i++) {
if (i % 3 == 0) {
$container.append($("<div>").addClass("row"));
}
$container.find(".row").last().append($cols.eq(i));
}
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment