Код, который я ниже, должен найти высоту самого большого столбца (.border) и отрегулировать высоту любых других столбцов, найденных в .container div, чтобы они были равны ему. К сожалению, мне не удалось заставить этот код работать должным образом, поэтому я надеюсь, что кто-то более мудрый, чем я, сможет мне помочь.
Также стоит упомянуть, что высота столбца должна пересчитываться, а размер столбца соответственно изменяться всякий раз, когда изменяется размер окна.
<script type="text/javascript">
$(document).ready(function(){
//Bind the window onresize event
$(window).bind('resize', resizeWindow);
//Call resizeWindow() function immediately to intiially set elements
resizeWindow();
});
function resizeWindow(){
//Find all the container parent objects
$('.container').each(function(){
//Initialize the height variable
var maxHeight = 0;
//Cache the jQuery object for faster DOM access and performance
var $borders = $(this).find('.border');
//Find all the border child elements within this specific container
$borders.each(function(){
//Get current element's height
var thisHeight = $(this).height();
//Check if the current height is greater than the max height thus far
//If so, change max height to this height
if (thisHeight>maxHeight) maxHeight = thisHeight;
});
//Now that we have the maximum height of the elements,
//set that height for all the .border child elements inside the parent element
$borders.height(maxHeight);
});
}
</script>
<div class="container">
<a href="#" class="border">
<div class="column">
<div class="content">asdf</div>
</div>
</a>
<a href="#" class="border">
<div class="column">
<div class="content">asdf</div>
</div>
</a>
</div>
columns
не подходит? - person Niet the Dark Absol   schedule 05.03.2013