Skip to content

Instantly share code, notes, and snippets.

@spencerfeng
Created June 14, 2018 12:47
Show Gist options
  • Save spencerfeng/57053ed37cfe1643ddcc2b3bbbe0c57b to your computer and use it in GitHub Desktop.
Save spencerfeng/57053ed37cfe1643ddcc2b3bbbe0c57b to your computer and use it in GitHub Desktop.
A jQuery plugin that creates equal height columns
$.fn.equalHeight = function(options) {
var maxHeight = 0;
this.each(function(index) {
var height = $(this).height();
if (height > maxHeight) { maxHeight = height };
});
return this.each(function(index) {
$(this).height(maxHeight);
});
};
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment