Skip to content

Instantly share code, notes, and snippets.

@realguess
Created January 30, 2016 13:22
Show Gist options
  • Save realguess/f7bdb85810955b155906 to your computer and use it in GitHub Desktop.
Save realguess/f7bdb85810955b155906 to your computer and use it in GitHub Desktop.
var biggestHeight = "0";
// Loop through elements children to find & set the biggest height
$(".container *").each(function(){
// If this elements height is bigger than the biggestHeight
if ($(this).height() > biggestHeight ) {
// Set the biggestHeight to this Height
biggestHeight = $(this).height();
}
});
// Set the container height
$(".container").height(biggestHeight);
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment