Created
April 3, 2018 18:23
-
-
Save Trippnology/dfa2ff496c97f6038821d0d9cbfe807f to your computer and use it in GitHub Desktop.
jQuery: Equalise height of set of elements
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
function equalizeHeight(selector) { | |
var maxheight = 0; | |
$(selector).each(function(){ | |
var height = parseInt($(this).css('height')); | |
if (height > maxheight ) { | |
maxheight = height; | |
} | |
}); | |
$(selector).css('height', maxheight); | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment