Created
June 14, 2018 12:47
-
-
Save spencerfeng/57053ed37cfe1643ddcc2b3bbbe0c57b to your computer and use it in GitHub Desktop.
A jQuery plugin that creates equal height columns
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
$.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