Skip to content

Instantly share code, notes, and snippets.

@zearadoua
Created November 3, 2017 10:57
Show Gist options
  • Save zearadoua/9ac341cbd58d22df608ca03f4e99361f to your computer and use it in GitHub Desktop.
Save zearadoua/9ac341cbd58d22df608ca03f4e99361f to your computer and use it in GitHub Desktop.
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