My first question would to be why are you using max-height: 0;
is there something else you can use? Like hide()
show()
which use display: none
the only thing I can thing of would be to remove the max-height css get the height and then reapply the max-height:
$('.div').css('max-height', 'none')
console.log($('.div').height())
$('.div').css('max-height', '0')
This should happen fast enough that you wont see the element but it could be wise to hide it before removing the max-height
with:
$('.div').hide()
$('.div').css('max-height', 'none')
console.log($('.div').height())
$('.div').css('max-height', '0')
$('.div').show()
display:none;
or jQuery's hide() and show() methods. – Cherianne