Skip to content

Instantly share code, notes, and snippets.

@peteboere
peteboere / jquery.balanceheights.js
Created February 17, 2012 09:53
Small jQuery plugins
/*
* Equalise the height of boxes (uses min-height).
*/
jQuery.fn.balanceHeights = function() {
// Get max height from list then apply to all.
var heights = [];
this.each( function () {
heights.push(jQuery(this).outerHeight());
});
return this.css('min-height', Math.max.apply({}, heights));