PDA

View Full Version : window size


charter
11-27-2002, 07:35 PM
Being a JavaScript newbie I am trying to find a way of opening a browser window to a variable size.

The size depending on screen resolution and monitor size.

I want the window to open to show just the BLUE title bar at the top and the taskbar at the bottom.

I have found the following script but it does not seem to work.
I am using I.E. 5.5

<script language="JavaScript1.2">
<!--
window.moveTo(0,0);
if (document.all) {
window.resizeTo(screen.availWidth,screen.availHeight);
}
else if (document.layers) {
if (window.outerHeight<screen.availHeight||window.outerWidth<screen.availWidth){
window.outerHeight = screen.availHeight;
window.outerWidth = screen.availWidth;
}
}
// -->
</script>

Could you please tell me what is wrong, if I need to add or remove anything.

I do not want the menu bars or the address bar showing.

All help would be much appreciated.:confused:

Borgtex
11-28-2002, 01:50 AM
It will not work the way you want with any window. You have to open a new window without menubars/address bars using window.open


for example in IE:

a=window.open('mypage.htm','','top=0,left=0,width='+screen.availWidth+',height='+screen.availHeight)
a.moveTo(-5,-5)

in my computer, however it shows a GREEN titlebar because I use a green color scheme :D