Home Articles FAQs XREF Games Software Instant Books BBS About FOLDOC RFCs Feedback Sitemap
irt.Org

Feedback: irt.org FAQ Knowledge Base Q240

Feedback on: irt.org FAQ Knowledge Base Q240

Sent by Brynna Donn on July 13, 1999 at 16:29:56: - feedback #298

Worth:
Worth reading

Length:
Too short

Comments:
I am using Netscape 4.5.
I'm opening a popup window with the following parameters:
toolbar=no,location=no,menubar=no,resize=yes,dependent=yes,width=400,height=230

I try to use window.resizeTo(400, 380) and it doesn't work. window.outerHeight = 380 does not work either.

resizeTo does work in IE.

Are there interactions with other parameters that cause resizeTo and outerHeight not to work on N4.5?



Sent by Howard Lloyd on May 12, 2000 at 17:43:43: - feedback #1216

Worth:
Worth reading

Comments:
This works in IE5.0 and NS 4.72:

<script LANGUAGE="Javascript1.2"></script>

</head>

<body onload="resize()";>

From comp.lang.javascript.





Sent by Kalin Agrawal on May 17, 2000 at 16:11:55: - feedback #1246

Worth:
Very worth reading

Length:
Just right

Technical:
Just right

Comments:
I've found a hacky way to get around the IE resize discrepancy:

For IE:
<script language="javascript">
to_set_W = 300;
to_set_H = 200;
w = document.body.clientWidth;
h = document.body.clientHeight;
offW = to_set_W - w;
offH = to_set_H - h;
window.resizeBy(offW, offH);
</script>

Explanation:
IE's clientWidth and clientHeight properties are read-only; the only way to change size is through resizeTo() and resizeBy(). The hack involves reading the current clientWidth and clientHeight and then figuring out by how much it is wrong and then resize accordingly, fixing the difference.

The result is that the clientHeight and clientWidth are adjusted to be the desired dimensions, good for framing known dimensions (e.g. an image), without worrying about the window's decorations (such as menus, toobars etc.).



©2018 Martin Webb