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

Feedback on: irt.org FAQ Knowledge Base Q240, May 17, 2000 at 16:11:55:

You are here: irt.org | About | Feedback | 1246 [ previous next ]

Feedback on:
irt.org FAQ Knowledge Base Q240

Sent by
Kalin Agrawal on May 17, 2000 at 16:11:55:

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.).



Other feedback on 'irt.org FAQ Knowledge Base Q240' - show all

©2018 Martin Webb