Hi I have four divs in a bootstrap row. I want all divs in this row to have the same height and not break responsibility. I don\'t know how to do this without breaking respo
I had same kind of situation wherein each column within a row should be of same height. By considering above answers and with little trick, it was easy to implement and resolve the issue of window resize also.
$(document).ready(function() {
//Initiate equalize on load
equalize();
});
//Equalize on resizing of window
$(window).resize(function() {
removeHeights();
equalize();
});
function equalize(){
$(".container .row").each(function() {
var heights = $(this).find("p").map(function() {
return $(this).height();
}).get(),
maxHeight = Math.max.apply(null, heights);
$(this).find("p").height(maxHeight);
});
}
function removeHeights(){
$(".container .row").each(function() {
$(this).find("p").height("auto");
});
}
Check the demo here - https://jsfiddle.net/3Lam7z68/ (Resize the output pane to see the each div column size's changing)