zarino wrote:
Hi!
I'd like to set all elements with the class ".inner" to have a minimum
height equal to the height of the browser's viewport. So, if the
window height is 550px, each of the '.inner' divs will have a minimum
height of 550px. I suspect it's bound to be super-easy to do with
jQuery, but newbie that I am, I can't figure it out. :-S
How would I go about doing this?
Many thanks,
Zarino
Benjamin already mentioned the dimensions plugin. With it included, try:
$(function() {
$('div.inner').css(($.browser.msie && $.browser.version < 7 ? '' :
'min-') + 'height', $(window).height() + 'px');
});
If you need to adjust on window resize try this:
$(function() {
$(window).bind('resize', function() {
$('div.inner').css(($.browser.msie && $.browser.version < 7 ?
'' : 'min-') + 'height', $(window).height() + 'px');
}).trigger('resize');
});
--Klaus