How can I determine the element is using css height or css max-height?
for instance, I have these two elements,
<div style="height:100px">fixed</div>
<div style="max-height:100px">max-height</div>
I want to change their height/ max-height to 100% when a button is clicked.
$('div').height('100%').height();
This will only change the first element not the second one.
I was thinking to use if condition to check:
if( use height ) $('div').height('100%').height();
else $('div').css({maxHeight:'100%'}).height();
But I don’t know how to check… any ideas? or you may have a better idea than mine?
You can use something like the below code to set both of them at once.
Hope this is useful!!