Skip to content

Instantly share code, notes, and snippets.

@jdcauley
Last active August 29, 2015 14:04
Show Gist options
  • Save jdcauley/c1fd984815b804de07e7 to your computer and use it in GitHub Desktop.
Save jdcauley/c1fd984815b804de07e7 to your computer and use it in GitHub Desktop.
Box Height
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