Reputation: 529
The code:
function setEqualHeight(columns) {
var tallestcolumn = 0;
columns.each(function(){
currentHeight = $(this).height();
if(currentHeight > tallestcolumn){
tallestcolumn = currentHeight;
}
});
if (tallestcolumn <= 1000) {
columns.height(tallestcolumn + 4);
}
}
$(document).ready(function() {
setEqualHeight($("#main-content-bottom-bg > div"));
});
I know its probably simple, but I just cannot figure out what I give. I would think something like this:
columns.minheight(tallestcolumn + 4);
Thanks.
Upvotes: 0
Views: 178
Reputation: 13371
use this function :
function setEqualHeight(columns){
var tallestcolumn = 0;
columns.each(function(){
currentHeight = $(this).height();
if(currentHeight > tallestcolumn){
tallestcolumn = currentHeight;
}
});
if (tallestcolumn <= 1000) {
columns.css("min-height",(tallestcolumn + 4)+"px");
}
}
$(document).ready(function() {
setEqualHeight($("#main-content-bottom-bg > div"));
});
Upvotes: 1
Reputation: 3460
Almost... try:
columns.css('min-height', (tallestcolumn + 4) + 'px');
Similar to: jQuery - Set min-height of div
Upvotes: 1
Reputation: 2384
Try this instead :
columns.css('min-height',(tallestcolumn + 4)+'px');
Upvotes: 0