Last active
August 29, 2015 14:04
-
-
Save jdcauley/c1fd984815b804de07e7 to your computer and use it in GitHub Desktop.
Box Height
This file contains hidden or 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
function boxHeight(target){ | |
var pricingBox = document.getElementsByClassName(target); | |
var boxHeights = [] | |
for (var i = 0; i < pricingBox.length; i++){ | |
var heights = window.getComputedStyle(pricingBox[i], null).getPropertyValue('height').replace("px", ""); | |
boxHeights.push(heights); | |
} | |
var tallest = Math.max.apply( null, boxHeights ); | |
for (var i = 0; i < pricingBox.length; i++){ | |
pricingBox[i].style.height=tallest+'px' ; | |
} | |
} | |
boxHeight('pricing-box'); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment