Skip to content

Instantly share code, notes, and snippets.

@peteboere
Created February 17, 2012 09:53
Show Gist options
  • Save peteboere/1852272 to your computer and use it in GitHub Desktop.
Save peteboere/1852272 to your computer and use it in GitHub Desktop.
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));
};
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment