Basically
I have several divs with flexible heights and fixed shims, so it's pretty difficult to have them all with the same height,
I try like this:
$(document).ready(function(){ $('.LevelCnt_2,.LevelCnt_2 .content,.LevelCnt_1,.LevelCnt_1 .content').outerHeight( $('header:eq(0)').outerHeight() ); console.log($('header:eq(0)').outerHeight(true)); });
But the problem is that the title is not always the highest, so I need
but I canβt find a good / wonderful way (I have one solution, but I need a lot of if and variables).
any clue?
-Edit -
while waiting, I came up with this
$(document).ready(function(){ var height = 0; $('.LevelCnt_2,.LevelCnt_2 .content,.LevelCnt_1,.LevelCnt_1 .content,header').each(function(){ if($(this).outerHeight() > height){ height = $(this).outerHeight(); } }); $('.LevelCnt_2,.LevelCnt_2 .content,.LevelCnt_1,.LevelCnt_1 .content,header').each(function(){ $(this).outerHeight(height); }); console.log('highest height is '+height);
but most of these divs are in display:none , what's the problem?
source share