Reputation: 2267
$('#menu-window-inner').css(
{'height':
(
($('#menu-window').height()) -
($('#menu-window-title').height()) -
($('#menu-window-footer').height())
)
}
);
So I'm trying to use the code above to set the height of "menu-window-inner". It works when I use the equation X=A-B, but not when I use X=A-B-C. Basically it only works when subtracting the height of one div, not two.
Anyone know the correct fix? Having read over the code and css it all looks correct to me so I'm bamboozled.
Upvotes: 0
Views: 969
Reputation: 15616
you can use outerHeight() and height() functions of jQuery here:
$('#menu-window-inner').height(
$('#menu-window').outerHeight() -
$('#menu-window-title').outerHeight() -
$('#menu-window-footer').outerHeight()
);
and your code is not working because wou need to append "px" at the end of the value when using CSS height property.
Upvotes: 3