that's brilliant, Klaus! Thanks for sharing that.

--Karl
_________________
Karl Swedberg
www.englishrules.com
www.learningjquery.com



On Jul 8, 2007, at 12:23 PM, Klaus Hartl wrote:


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

Reply via email to