> Is it possible to get the actual document size? Not the window size,
> but the actual rendered document size, which in my case is bigger than
> the window.
Not consistently, but most modern browsers accept:
document.documentElement.offsetWidth
and
document.documentElement.offsetHeight
(You should be in standards mode to guarantee that the documentElement
exists, otherwise you might get the result from document.body).
/L

Signature
Lasse Reichstein Nielsen - lrn@hotpop.com
DHTML Death Colors: <URL:http://www.infimum.dk/HTML/rasterTriangleDOM.html>
'Faith without judgement merely degrades the spirit divine.'
Captain Dondo - 18 Apr 2006 19:09 GMT
>>Is it possible to get the actual document size? Not the window size,
>>but the actual rendered document size, which in my case is bigger than
[quoted text clipped - 8 lines]
>
> /L
Hah! Googling on documentElement found this:
http://www.quirksmode.org/js/doctypes.html
For posterity....
TheBagbournes - 22 Apr 2006 07:58 GMT
>> Is it possible to get the actual document size? Not the window size,
>> but the actual rendered document size, which in my case is bigger than
[quoted text clipped - 8 lines]
>
> /L
That does not do it. Try creating a very wide element that overflows the
window. In that case document.documentElement.offsetWidth returns the
window width.
I scrabbled around this for a while because I wanted to make a "dialog
box" (which was in fact an absolutely positioned div) "modal". So I
created a 0% opaque, full sized div to sit over the document, but under
the "dialog box" (I had to use opacity to allow the document to show
through because if I set the background-color to transparent, IE didn't
acknowledge that it was there, and allowed user interaction with the
underlying document!!)
So this blocker had to be full size.
I don't have the code to hand, it's at work. I'll post it on Monday.
ExG
TheBagbournes - 29 Apr 2006 10:32 GMT
>> Is it possible to get the actual document size? Not the window size,
>> but the actual rendered document size, which in my case is bigger than
[quoted text clipped - 8 lines]
>
> /L
I found my code. It was the width it was having trouble with. If there
was a very wide element in the document, then
document.documentElement.offsetWidth did not work - just returned the
viewport width. I used
fcl.util.getDocumentWidth = function()
{
if (document.body.scrollWidth)
return document.body.scrollWidth;
var w = document.documentElement.offsetWidth;
if (window.scrollMaxX)
w += window.scrollMaxX;
return w;
};
fcl.util.getDocumentHeight = function()
{
if (document.body.scrollHeight)
return document.body.scrollHeight;
return document.documentElement.offsetHeight;
};