すべての列 ( 、および)if
の高さを等しくするために、いくつかの文を作成しました。ただし、何らかの理由で関数を使用して値を取得できますが、 other から取得した値を設定しようとすると機能しません。#col1
#col2
#col3
.css()
var
これは私のjqueryコードです:
$(document).ready( function(){
var col1_height = $('#col1').css('height');
var col2_height = $('#col2').css('height');
var col3_height = $('#col3').css('height');
if (col1_height < col2_height){
$('#col1').css('height', col2_height);
}
if (col1_height < col3_height){
$('#col1').css('height', col3_height);
}
if (col2_height < col1_height){
$('#col2').css('height', col1_height);
}
if (col2_height < col3_height){
$('#col2').css('height', col3_height);
}
if (col3_height < col1_height){
$('#col3').css('height', col1_height);
}
if (col3_height < col2_height){
$('#col3').css('height', col2_height);
}
});
これが私のjsfiddleです:http://jsfiddle.net/Arkl1te/aNcYC/