Last active
August 17, 2016 15:45
-
-
Save timstl/6124173 to your computer and use it in GitHub Desktop.
jQuery plugin to equalize height of a set of elements if you can't do so via CSS for whatever reason.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/* | |
Column Equalize | |
Example: $('.col-equalize .col').colequalize(); | |
*/ | |
;(function($) { | |
$.fn.colequalize = function(options) { | |
var h = 0; | |
this.each(function() { | |
var $this = $(this), | |
thish = parseFloat($this.height()); | |
if (thish > h) { h = thish; } | |
}); | |
if (h > 0) { this.height(h); } | |
}; | |
})(jQuery); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment