I can’t get the heights of my buttons to match using the following code. I have jQuery imported. Any ideas? I’m sure it’s something obvious I’m overlooking.
<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>
you shouldn’t be using the same ID for more than one attribute.
you probably get only one element from $(‘#imageUploadBtn’)
try using
$(‘.span2’)
instead