Created
November 22, 2017 15:16
-
-
Save muex/ecea746f7d4eb3ac53a249528a12670a to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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