Calculate a div's height with jQuery - minus header and footer
- by Dirty Bird Design
I'm using a sticky footer (negative margin solution) and it works fine. What I need to do is calculate the window's height, subtract the known height of the header and footer then apply that number and use it for the height of the main wrapper div. CSS solutions cause other issues, is there a good way to do this?
var h = window.height();
var k = 300; //header is 100px footer is 200px
$('#wrap').height(h-k);
rough idea, pls help.