PDA

View Full Version : Window Attributes


Muon
03-10-2003, 11:38 AM
Hi,

I have a couple of questions:

1) I was thinking of having my main page automatically resize onLoad using the reSizeTo(....) method. I want to first check the current width and height to see if resizing is required. How do I do this?

2) Is it possible to add/remove components from the browser interface (such as status bar, address bar, tool bar, etc) from the current window, or is it only possible to access these parameters as part of a window.open call?

Cheers!

joh6nn
03-10-2003, 07:26 PM
1) to check the size of a window in MSIE, it's window.body.clientWidth and .clientHeight. in NS, it's window.innerWidth and .innerHeight.

2) you can only control the components on windows you open; you can't control the ones that are already open.

Muon
03-10-2003, 08:00 PM
Thanks joh6nn,

the following code seems to work fine in MSIE:

var winW = document.body.clientWidth;
var winH = document.body.clientHeight;
var aString = "width= " + winW + ". height= " + winH + ".";
alert(aString);

nice one, cheers

Vladdy
03-11-2003, 11:46 AM
Originally posted by Muon
I was thinking of having my main page automatically resize onLoad using the reSizeTo(....) method. I want to first check the current width and height to see if resizing is required. How do I do this?


Imagine you are sitting in your living room enjoying the view outside. Then there is some guy, who was passing by, starts rebuilding your window (or even hacking away new ones), just because HE thinks he would look better to you this way... :rolleyes: :rolleyes: :rolleyes:

Muon
03-11-2003, 11:52 AM
true enough Vladdy,

like I said:

I was thinking of having my main page automatically resize; I didn't say I was actually going to do it... ;)

(joking - you're right, it was a bad idea)