I am currently using jQuery to retrieve the height of one div and apply that value as a CSS property to another.
Let's take a look at a sample layout:
<div class="row">
<div class="column image">
<img src="image.jpg" />
</div>
<div class="column content">
<p>Content</p>
</div>
</div>
<div class="row">
<div class="column content">
<p>Content</p>
</div>
<div class="column image">
<img src="image.jpg" />
</div>
</div>
Here is the relevant jQuery code:
function displayHeight( element, height ) {
$( "div.image" ).css("height", height);
}
displayHeight( "div", $( ".content" ).height() );
This function extracts the height from ".content" and applies it to ".image". While this works for single instances, my goal is to create a more versatile solution that can handle multiple instances without duplicating functions.