Skip to content

Instantly share code, notes, and snippets.

@Trippnology
Created April 3, 2018 18:23
Show Gist options
  • Save Trippnology/dfa2ff496c97f6038821d0d9cbfe807f to your computer and use it in GitHub Desktop.
Save Trippnology/dfa2ff496c97f6038821d0d9cbfe807f to your computer and use it in GitHub Desktop.
jQuery: Equalise height of set of elements
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