Welcome to WebmasterWorld Guest from

Forum Moderators: incrediBILL

Message Too Old, No Replies

Page Height/Width for NN6



12:01 pm on Sep 5, 2001 (gmt 0)

I've got a problem that I hope someone here can help me with.
I'm showing a page from another site in an IFrame/ILayer. The included page lets the parent know its dimensions by calling a function from the parent with its height and width as parameters. This works fine in IE (using document.body.scrollHeight,document.body.scrollWidth). I tried using document.body.offSetHeight/Width for NN6, but although the height was acceptable, the width was way off.
Any suggestions?


2:55 pm on Sep 5, 2001 (gmt 0)

10+ Year Member

Hi Aelfwine,

I think this is a known bug... read about it at a mozilla newsgroup. I think it has to do with whether or not margin and padding is included in the measurement.

Try document.width and document.height in NN4+ including NS6.


11:13 am on Sep 6, 2001 (gmt 0)

Hi Mike,

I tried using document.width (which gives me the same value as document.body.offsetWidth) and window.innerWidth which gives me the same value plus 16. The funny thing is that it is giving me the value of the width of the iframe and not itself. IE's scrollWidth gives me the correct width plus 20 (scrollbar width?) only if it is >= the width of the iframe, otherwise it gives me the width of the iframe like NS6. It seems that NS6 only looks at the container when it comes to width.

I'm impressed with your work at Cross-Browser.


7:46 pm on Sep 6, 2001 (gmt 0)

10+ Year Member

Hi Aelfwine, Thanks!

Sorry I can't be any more help... This is a topic that I need to do more testing on.


Featured Threads

Hot Threads This Week

Hot Threads This Month