I need a function to get the height of the highest element inside a div.
I have an element with many others inside (dynamically generated), and when I ask for the he
In my case I had to use it with a responsive design so I made it work with window resize.
function fixHeight(elem){
var maxHeight = 0;
$(elem).css('height','auto');
$(elem).each(function(){
if ($(this).height() > maxHeight) { maxHeight = $(this).height(); }
});
$(elem).height(maxHeight);
}
$(window).resize(function () {
fixHeight('.myelement');
});
$(document).ready(function(e) {
fixHeight('.myelement');
});
I hope this will help someone !
Happy coding guys ! :)