I have several of the same class of element on a page and am attempting to get them all to be the same height even though the content within varies slightly. I've put together a small function that yields results in both Firefox 2+ and Safari 3+ but apparently doesn't even register in IE 7. Here's what I'm using:
var tallestcopy = 0;
$(".calloutL2Copy").each(
function(index) {
var tallest = $(this).height();
if (tallest > tallestcopy) {
tallestcopy = tallest
}
});
$(".calloutL2Copy").css("height",tallestcopy);
Where the class ".calloutL2Copy" is applied to a div containing some text and the occasional image. I've also tried replacing the last line with:
$(".calloutL2Copy").height(tallestcopy);
Again, this works in Firefox and Safari but has no effect on the same divs in IE. I've verified that IE is getting the tallest pixel value correct, it's just not applying it to the siblings. Can anyone offer up some advice to get this thing working?
UPDATE:
Here's a sample of the code from the site where I'm trying to apply this technique. I didn't write the code (and am aware there's a serious case of div-itis), I'm only trying to fix CSS errors.
<div id="calloutL2Top">
<div class="calloutL2">
<a href="#"><img class="calloutL2Img" alt="" src="something.jpg" width="217" height="81"></a>
<div class="calloutL2Copy">
<h3>Lorem Ipsum</h3>
Sed do eiusmod tempor incididunt ut labore et dolore magna aliqua. Ut enim ad minim veniam, quis nostrud exercitation ullamco laboris nisi ut aliquip ex ea commodo consequat.
</div>
</div>
<div class="calloutL2">
<a href="#"><img class="calloutL2Img" alt="" src="something.jpg" width="217" height="81"></a>
<div class="calloutL2Copy">
<h3>Lorem Ipsum</h3>
Sed do eiusmod tempor incididunt ut labore et dolore magna aliqua. Ut enim ad minim veniam, quis nostrud exercitation ullamco laboris nisi ut aliquip ex ea commodo consequat.
</div>
</div></div>
UPDATE AGAIN:
I got the go ahead from the higher powers and I'm going to post the IP of the site directly do the pages in question so you can view firsthand what the problem is:
[url removed]
What I'm trying to fix are the series of boxes along the bottom of the main content area. Hopefully this is a little more helpful.