Skip to content

Instantly share code, notes, and snippets.

@thierrypigot
Last active August 29, 2015 14:05
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save thierrypigot/2e6bca1f45720425f8e2 to your computer and use it in GitHub Desktop.
Save thierrypigot/2e6bca1f45720425f8e2 to your computer and use it in GitHub Desktop.
equalHeight.js
/* Equal Height for html element */
function equalHeight( group )
{
var tallest = 0;
var thisHeight = 0;
group.each(function() {
thisHeight = jQuery(this).height();
if(thisHeight > tallest) {
tallest = thisHeight;
}
});
group.height( tallest );
}
jQuery(document).ready(function(){
equalHeight( jQuery(".equal-height-column") );
});
@thierrypigot
Copy link
Author

The script search for the bigger box (.equal-height-column css class in this exemple) and give this size to the smaller others.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment