Skip to content

Instantly share code, notes, and snippets.

Embed
What would you like to do?
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