jQuery - Set the height of one DIV to another DIV

| | 1 min read

We were trying to create a new theme for our Drupal site and we came across an issue. How to create div "left" to be the same height as div "right" which can be smaller or bigger?

Is it possible to have the "left" div height adjusts automatically according to the "right" div height?

Here is what saved us:

Retrieve the height of one div '.style_right_side_content' and apply it to another div ('.style_left_side_content')'s min-height. Use the following JQuery code:

var divHeight = $('.style_right_side_content').height(); 
$('.style_left_side_content').css('min-height', divHeight+'px');