Created
October 16, 2014 14:54
-
-
Save jeremyzahner/b383d9991bc37f6a0728 to your computer and use it in GitHub Desktop.
Function to equalize the height of elements (i.E. inside a Grid) with jQuery.
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
// This function knowingly also invokes the parent element, so if some changes need to be done to that its already there. | |
var sameheights = function (parent_item_object,child_item_cssstring){ | |
var heights = []; | |
parent_item_object.each(function(e){ | |
heights.push( $(this).children(child_item_cssstring).height() ); | |
}); | |
parent_item_object.each(function(e){ | |
$(this).children(child_item_cssstring).css('min-height', Math.max.apply(Math, heights)); | |
}); | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment