0
我想調整行中的2列。 第一列是最高的,其他列需要擴展到相同的高度。引導行調整大小事件
我測試以下,但它不工作
<div class="row" id="top-row">....
$('#top-row').on('resize', function() { /*col-2,3 height = col-1 height*/ });
但功能不工作。
我想調整行中的2列。 第一列是最高的,其他列需要擴展到相同的高度。引導行調整大小事件
我測試以下,但它不工作
<div class="row" id="top-row">....
$('#top-row').on('resize', function() { /*col-2,3 height = col-1 height*/ });
但功能不工作。
html
<div class="row">
<div class="col-xs-4">
block 1
</div>
<div class="col-xs-4">
block 2
</div>
<div class="col-xs-4">
block 3
</div>
</div>
JS
$(function() {
var $paragraphs = $('#top-row .col-xs-4'),
heights = [];
$paragraphs.each(function() {
heights.push($(this).height());
});
var maxHeight = Math.max.apply(this, heights);
$paragraphs.height(maxHeight);
});
這將花費最長塊的高度,將適用於所有
感謝您的例子,它工作正常:-) – Phil795
'( '調整')'事件適用於'只有window'對象。 –
你怎麼看待用CSS解決這個問題? 'display:table-cell'可以做到完美。 –
您可以在CSS中添加最小高度 –