代码:
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"));
});
我知道它可能很简单,但我无法弄清楚我给的是什么。我会想到这样的事情:
columns.minheight(tallestcolumn + 4);
感谢。
答案 0 :(得分:1)
差不多......试试:
columns.css('min-height', (tallestcolumn + 4) + 'px');
答案 1 :(得分:1)
使用此功能:
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"));
});
答案 2 :(得分:0)
请改为尝试:
columns.css('min-height',(tallestcolumn + 4)+'px');