Forum Moderators: open

Message Too Old, No Replies

Centering a resized window + getting rid of toolbars and status bar

         

domoftheuk

3:25 pm on Jan 15, 2004 (gmt 0)

10+ Year Member



Please help

Centring a resized window + getting rid of toolbars and status bar

chadmg

3:42 pm on Jan 15, 2004 (gmt 0)

10+ Year Member



Hi Dom,
I don't believe you can get rid of toolbars and the status bar of window you have not opened.

To center a window you would need to get the screen width of the user, subtract the window width and then divide by 2. And do the same for the height.

window.moveTo(((screen.availWidth-browserWidth)/2), ((screen.availHeight-browserHeight)/2));

This is assuming you know the browser width and height, since you just resized it. If not use...

if (document.layers){
browserWidth=window.outerWidth;
browserHeight=window.outerHeight;
}
if (document.all){
browserWidth=document.body.clientWidth;
browserHeight=document.body.clientHeight;
}

domoftheuk

3:55 pm on Jan 15, 2004 (gmt 0)

10+ Year Member



thanks chadmg i'll give that a go opefully thats the solution

domoftheuk

1:14 am on Jan 17, 2004 (gmt 0)

10+ Year Member



got it i've done it

<head>

<SCRIPT>
window.moveTo(250,250)
window.resizeTo(532,355);
</SCRIPT>

</head>

thanks anyway