I need to set equal height on a series of divs inside another div wrapper. The problem is that I dont want the same height on all of them. The page kind of have 3 columns an
I went with somethin like Peter suggested. I rewrote the plugin to:
$.fn.cleverHeights = function(px) {
$(this).each(function(){
var currentTallest = 0;
var width = 0;
var row = new Array();
$(this).children().each(function(i){
if ($(this).height() > currentTallest) { currentTallest = $(this).height(); }
width += parseInt($(this).outerWidth(), 10);
row[++row.length] = $(this);
if (width > 900) {
$.each( row , function() {
$(this).css({'min-height': currentTallest});
// for ie6, set height since min-height isn't supported
if ($.browser.msie && $.browser.version == 6.0) { $(this).css({'height': currentTallest}); }
});
row.length = 0;
width = 0;
currentTallest = 0;
}
});
});
return this;
};
Thanks for the input