I have a page with a few divs for which I wrote a script to adjust the height of it appropriately. Each div contains 2 divs in it and a small script is written to calculate the highest of these divs and lines them up correctly. The problem is that all the divs on the page are now assigned the same height. I would like it to calculate separately for each div.
HTML
<article>
<div class="inner-content-container equalHeight">
some text....
</div>
<div class="entry-sidebar equalHeight"> some text...</div>
</article>
<article>
<div class="inner-content-container equalHeight">
some text....
</div>
<div class="entry-sidebar equalHeight"> some text...</div>
</article>
<article>
<div class="inner-content-container equalHeight">
some text....
</div>
<div class="entry-sidebar equalHeight"> some text...</div>
</article>
jQuery
var highestCol2 = Math.max(jQuery('.entry-sidebar').height(),jQuery('.inner-content-container').height());
jQuery('.equalHeight', this).height(highestCol2);
thisin your jQuery call to specify a function that will affect each selected element individually. How you calculate the height individually is up to you. Please provide a fiddle if you want any further help.height:CSS restriction and instead use something likemin-height:, then the div will grow naturally to the content within it, width restrictions given of course.