我无法使用以下代码使按钮的高度匹配。我已经导入了 jQuery。有任何想法吗?我敢肯定,我忽略了一些明显的事情。
<div class="row-fluid " id="imageUploadBtns">
<div class="span2 offset2" id="imageUploadBtn">
Some Text
</div>
<div class="span2" id="imageUploadBtn">
...
</div>
<div class="span2" id="imageUploadBtn">
...
</div>
<div class="span2" id="imageUploadBtn">
...
</div>
</div>
<script>
boxes = $('#imageUploadBtn');
maxHeight = Math.max.apply(
Math, boxes.map(function() {
return $(this).height();
}).get());
boxes.height(maxHeight);
</script>