Skip to content

Instantly share code, notes, and snippets.

Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save ztg-zlu/ef37c380a996c6c556d0893534095e84 to your computer and use it in GitHub Desktop.
Save ztg-zlu/ef37c380a996c6c556d0893534095e84 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