$.fn.findMaxHeight = function() {
var wrapperHeight = $(this).height();
var wrapperMaxHeight = $(this).css('max-height');
if ( wrapperHeight == wrapperMaxHeight ) {
alert("max-height reached");
} else {
alert("not yet");
}
}
$('.subscription-wrapper').findMaxHeight();
$('.payment-wrapper').findMaxHeight();
...不起作用,因为.css()
退货300px
和.height()
退货300
所以它们无法比较。我如何解决它?