I have two DIVs, .sidebar
and .content
and I want to set .sidebar
to keep the same height with the .content.
I\'ve tried the f
eje211 has a point about using CSS to style your page. Here are two methods to use CSS, and one method using scripting to accomplish this:
This article makes equal column heights without CSS hacks.
Here is a method to get equal column heights using a CSS hack.
and lastly, if you do want to use javascript/jQuery, you could use the equalize heights script that the jQuery .map() page has as a demo.
$.fn.equalizeHeights = function(){
return this.height( Math.max.apply(this, $(this).map(function(i,e){ return $(e).height() }).get() ) )
}
then just use it as follows:
$('.sidebar, .content').equalizeHeights();