Skip to content

Instantly share code, notes, and snippets.

@KB1RMA
Last active August 29, 2015 14:03
Show Gist options
  • Save KB1RMA/dfa3f766bacfe3607115 to your computer and use it in GitHub Desktop.
Save KB1RMA/dfa3f766bacfe3607115 to your computer and use it in GitHub Desktop.
jQuery plugin to quickly set multiple divs to the same height. There's credit to be given to the original, but I can't remember where it came from.
// Usage:
// $('.unevenheights').setAllToMaxHeight();
;(function ($) {
'use strict';
$.fn.setAllToMaxHeight = function () {
return this.height(Math.max.apply(this, $.map( this , function (e) { return $(e).height() }) ) );
}
}(jQuery));
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment