hi hi!
I have encounter a problem that need to equal height in different classes.
Currently I using this code from cssnewbie:
function equalHeight(group) {
var tallest = 0;
group.each(function() {
var thisHeight = $(this).height();
if(thisHeight > tallest) {
tallest = thisHeight;
}
});
group.height(tallest);
}
$(document).ready(function() {
equalHeight($(".contentA"));
equalHeight($(".contentB"));
});
The scenario is 3 columns boxes need to have an equal height. It has background and content. Left and middle boxes sharing the same class and ID, and the right box has different class and ID. It is 2 row and 3 column.
Now the bottom left and middle are looking fine, but not the right column boxes.
Is it possible to calculate the tallest height - the shortest height, then get the remaining height to add into the shortest height. So it is equal.
Any code I can reference?
Thanks!