today I have a quick question. Here is my function:
function checkheight() {
var heightofdiv = $('#checkforheight').height();
$("#centeredbackground").css("min-height",heightofdiv);
}
My problem is that I want to get my variable, heightofdiv, and then subtract the answer by 42 pixels. So really, I want heightofdiv to be equal to the height of checkforheight minus 42 pixels. If this is even possible, help would be greatly appreciated. Thanks!
Can you not simply subtract 42 from $('#checkforheight').height()
?
var heightofdiv = $('#checkforheight').height() - 42;
What's stopping you from just doing this?
$('#checkforheight').height() - 42;
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With