Skip to content

Instantly share code, notes, and snippets.

@muex
Created November 22, 2017 15:16
Show Gist options
  • Save muex/ecea746f7d4eb3ac53a249528a12670a to your computer and use it in GitHub Desktop.
Save muex/ecea746f7d4eb3ac53a249528a12670a to your computer and use it in GitHub Desktop.
var
elements = document.querySelectorAll(".well"),
heights = [];
/* Getting an array with the heights */
[].forEach.call(elements, function(each) {
heights[heights.length] = getComputedStyle(each, null).getPropertyValue("height");
});
/* Sorting the array to get the greatest value first */
heights.sort(function(a, b) {
return parseFloat(b) - parseFloat(a);
});
/* Applying the greatest height to each element */
[].forEach.call(elements, function(each) {
each.style.height = heights[0];
});
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment