Skip to content

Instantly share code, notes, and snippets.

@saxap
Created October 16, 2016 10:20
Show Gist options
  • Save saxap/0a3b941dfef1dd53e7157a91c957fde7 to your computer and use it in GitHub Desktop.
Save saxap/0a3b941dfef1dd53e7157a91c957fde7 to your computer and use it in GitHub Desktop.
function set_max_height(elms, addh) {
if (typeof(addh) === 'undefined') addh = 0;
var maxHeight = Math.max.apply(null, elms.map(function (){
return jQuery(this).height();
}).get());
elms.height(maxHeight+addh);
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment