On Tuesday 11 March 2003 13:26, adam beecher wrote:
> > Adam's code doesn't work either because self.document.body.clientWidth is
>> not
>> > equivalent to document.width (ditto height).
>> As I explained, this is why the first resize is required: IE5 doesn't
> /have/ an equivalent to document.width, so it needs to be resized as a
> reference point. By the way, I've used the code I sent and tested it in all
> the 4+ browsers and equivalents, and it works for accurate browser window
> resizing in everything but tabbed browsers.
Perhaps I wasn't clear enough as to what "Adam's code doesn't work either"
meant. You had
self.resizeTo(100, 100);
w = (100 - self.document.body.clientWidth) + <?=$w?>;
h = (100 - self.document.body.clientHeight) + <?=$h?>;
self.resizeTo(w, h);
The (100 - self.document.body.clientWidth) and (100 -
self.document.body.clientHeight) are tautologies here because after
self.resizeTo(100, 100) you have self.document.body.clientWidth = 100 and
self.document.body.clientHeight = 100 from what I can see. So the 4 lines
above can be replaced by
self.resizeTo(<?=$w?>, <?=$h?>);
which will work just fine in that it will resize the window to the size I
specify, but that's no advance on what I already have. I need to be able to
ask:
Now that this document has been rendered, what are the dimensions of the box
which would just contain it ?
Resize the window to those dimensions.
document.width and .height provide that information for NS4. It doesn't seem
to be possible to get it in IE. I was wondering if perhaps someone could
suggest some DOM magic which might work e.g. place everything on a layer, get
the dimensions of the layer, resize the window to suit.
Niall
Maintained by the ILUG website team. The aim of Linux.ie is to
support and help commercial and private users of Linux in Ireland. You can
display ILUG news in your own webpages, read backend
information to find out how. Networking services kindly provided by HEAnet, server kindly donated by
Dell. Linux is a trademark of Linus Torvalds,
used with permission. No penguins were harmed in the production or maintenance
of this highly praised website. Looking for the
Indian Linux Users' Group? Try here. If you've read all this and aren't a lawyer: you should be!