Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations SkipVought on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Two netscape questions...

Status
Not open for further replies.

gameon

Programmer
Feb 23, 2001
325
0
0
GB
Hi, I am trying to find two things:

i) the width of the page window (not the screen.width) IE the size of a window, someone may have it only half as wide as their monitor...

ii) the height of the web page or body or whatever.

It was be amazingly fantastic if you could enlighten me - or a tip.

M@
 
netscape:
window.innerWidth
window.innerHeight

(I think)

IE uses document.body.scrollWidth or document.body.offsetWidth and document.body.scrollHeight or document.body.offsetHeight (can't remember which off the top of my head).

Bear in mind that these will not include the scrollbars so you'll need to add 20px for IE, @16px for netscape.

hope this is of some use

Joe
 
That's great mate, and working nice.

The only thing that I'm still chasing is being able to find the height of the page.

Maybe this can be found from working out the scroll height, or the body height?

Dunno, do you?

M@
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top