| Welcome to WebmasterWorld Guest from 18.104.22.168 |
register, free tools, login, search, pro membership, help, library, announcements, recent posts, open posts,
|Become a Pro Member|
|Howto get the viewport height and width WITHOUT scrollbar?|
I Have an small problem.
I Need to get the viewport width and height.
I Tested the following:
Real size without scrollbars:
- Height: 389px
- Width: 614px
window.innerHeight & window.innerWidth:
- Opera: H:405 - W:630
- FF: H:405 - W:630
- IE: H: x - W: x
document.body.clientHeight & document.body.clientWidth:
- Opera: H:389 - W:614
- FF: H:431 - W:598
- IE: H:389 - W:614
document.documentElement.clientHeight & document.documentElement.clientWidth:
- Opera: H:571 - W:614
- FF: H:389 - W:614
- IE: H: 0 - W: 0
How can i get the inner height and width without scrollbars from all browsers, without doing an browser detect.
a) Use a full (strict) doctype
b) Try again :)
a) this whas already the case.
But it could be i forgot to do this in my testing script :S.
Can't remember, so i have to do it again.
Thx for the reminder.
I ReTryed it with an valide doctype.
Same results, except that IE has an value in document .documentElement.client*.
I would suggest you to use some js cross-browser library.
All trademarks and copyrights held by respective owners. Member comments are owned by the poster.
WebmasterWorld is a Developer Shed Community owned by Jim Boykin.
© Webmaster World 1996-2014 all rights reserved