Dynamic Container Height (jQuery Only)
I have a fixed-height (180px) header and fixed-height footer (50px). I'd like the container height to be: window height MINUS header MINUS footer. If the container height can be updated on window resize, that'd be awesome!
I posted t开发者_开发问答he same question and receive a great answer with a CSS only solution, it works but still have issues in IE6 and 7, so I'd like a jquery Only solution if possible.
You can use the resize event, like this: (untested)
var expandingDiv = $('...');
$(window).resize(function(e) {
expandingDiv.height(document.documentElement.clientHeight - (180 + 50));
});
精彩评论