Skip to content

Instantly share code, notes, and snippets.

@jimmynotjim
Created August 8, 2012 02:15
Show Gist options
  • Star 1 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save jimmynotjim/3291471 to your computer and use it in GitHub Desktop.
Save jimmynotjim/3291471 to your computer and use it in GitHub Desktop.
Another equal height columns script
// equalize height for content area with sidebar
var equalize = Math.max(
$('.main').height(),
$('.sidebar').height()
);
$('.content').height(equalize);
@Abban
Copy link

Abban commented Aug 8, 2012

You can do this in css too if its just a border:

.main{
    border-right: 1px solid #ccc;
}
.sidebar{
    border-left:1px solid #ccc;
    margin-left:-1px;
}

Will always keep a 1px #ccc border for the entire height of the content.

@germanny
Copy link

So far, this one seems to be the most reliable (at least for what I'm working on):

http://www.broken-links.com/2009/01/20/very-quick-equal-height-columns-in-jquery/

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