I want to make two div
s the same height. But one div is smaller one while one is taller. Can someone explain how I can make them always the same?
Have some code here:
$(function() {
var a = $(.box1);
var b = $(.box2);
function calcHeight(a, b){
if (a.height() > b.height()) {
b.css("height", a);
} else {
a.css("height", b);
}
}
calcHeight(a,b)
$(window).on('resize', function(){
calcHeight(a,b)
})
})
<div class="flexcontainer"> ---rows are in flex-direction: row;
<div class="row1"> --- boxes are one below other
<div class="box1"></div>
<div class="box2"></div>
</div>
<div class="row2">
<div class="box3"></div> --- This box is full-height
</div>
<div class="row3"> --- boxes are one below other
<div class="box4"></div>
<div class="box5"></div>
</div>
</div>
I want box5
and box2
to be always the same height.
Thanks!