Skip to content

Instantly share code, notes, and snippets.

@FernE97
Created May 10, 2012 02:34
Show Gist options
  • Save FernE97/2650622 to your computer and use it in GitHub Desktop.
Save FernE97/2650622 to your computer and use it in GitHub Desktop.
JS: Equal height containers
// equal height containers
var contentHeight = $('.content').height();
var sidebarHeight = $('.sidebar').height();
if (contentHeight < sidebarHeight) {
$('.content').css('height', sidebarHeight + 'px');
} else {
$('.sidebar').css('height', contentHeight + 'px');
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment