...

View Full Version : window.height vs. window.availHeight



contiw
06-30-2005, 04:42 PM
window.height and window.availHeight both return 600px even though the IE browser window is open normally (not in full screen mode).

I thought window.availHeight should exclude system elements such as the window taskBar and return only the height of the active portion of the screen.

Am I wrong?

Thanks for helping
ContiW

Mr J
06-30-2005, 05:15 PM
Try some of these in IE and Moz

document.body.clientWidth
document.body.clientHeight

document.body.offsetWidth
document.body.offsetHeight

Window.innerWidth
Window.innerHeight

Window.outerWidth
Window.outerHeight

document.getElementsByTagName('body')[0].offsetWidth
document.getElementsByTagName('body')[0].offsetHeight

document.documentElement.offsetWidth
document.documentElement.offsetHeight

contiw
06-30-2005, 07:39 PM
Thank you Mr J. Good hint. This is what I came out with :

if (self.innerHeight){y = self.innerHeight;}
else if (document.documentElement && document.documentElement.clientHeight){y = document.documentElement.clientHeight;}
else if (document.body){y = document.body.clientHeight;}

All the best.
ContiW



EZ Archive Ads Plugin for vBulletin Copyright 2006 Computer Help Forum