PDA

View Full Version : Javascript Window Properties


wyclef
04-02-2004, 04:33 PM
Hello,

Can someone tell me how to include the window properties into this script? Menubar, Toolbar, Resize, Scrollbar, etc.?


<html>
<head>
<title></title>

<script type="text/javascript" language="JavaScript">


<!--


window.onload = function() {


var width,height,new_x,new_y;


// New width/height
width = 640;
height = 440;

// Set the new x/y values for the window
// This will move the window to the center of the screen
new_x = ((screen.availWidth / 2)- (width / 2));
new_y = ((screen.availHeight / 2) - (height / 2))

// Resize the window and move it to the center of the screen
window.resizeTo(width,height);
window.moveTo(new_x,new_y);


}
-->
</script>




</head>

<body>
s
</body>
</html>

Cota
04-03-2004, 01:09 AM
I think you can just add this code:

self.menubar.visible=false;
self.toolbar.visible=false;
self.locationbar.visible=false;
self.personalbar.visible=false;
self.scrollbars.visible=false;
self.statusbar.visible=false;

wyclef
04-03-2004, 02:27 PM
I think that method works only in Netscape. Is there one that is more of a cross-platform cross browser method?

Cota
04-03-2004, 09:28 PM
I was under the impression that code was cross-platform. Sorry I couldnt help more.

Cota
04-06-2004, 11:45 PM
So I was doing alittle research and all I could find was that damn window.open. Do ResizeTo or MOveTo accept any other parameters?

tg
04-07-2004, 10:17 AM
resizeTo only takes width/height
moveTo only takes x/y

wyclef
04-07-2004, 10:45 AM
Wouldn't there be another way to code


window.menubar.visible=false;
window.toolbar.visible=false;
window.locationbar.visible=false;


That involved (0) or (1) instead of false? Maybe if it's formatted a different way it would work cross browser because that currently works in Netscape.

tg
04-07-2004, 10:54 AM
you might get better results on javascript manipulation of the window object from a javascript specific site.