HTML and CSS Reference
In-Depth Information
The window object's open() method has a number of options listed in Table 10.6 that
allow you to further customize the new window.
Table 10.6 The open() Method and Its Options
Option
Values
Gives the Window
directories
Yes/no or 1/0
Directory buttons
height
Integer value
Height in pixels
location
Yes/no or 1/0
A location box
menubar
Yes/no or 1/0
A menu bar
resizable
Yes/no or 1/0
The ability to be resized
scrollbars
Yes/no or 1/0
Scrollbars along the side
status
Yes/no or 1/0
A status bar
toolbar
Yes/no or 1/0
A toolbar
width
Integer value
Width in pixels
EXAMPLE 10.8
<html>
<head><title>Opening a New Window with Parameters
and Closing It</title>
<script type="text/javascript">
1
function newWindow(){
2
winObj=window.open("http://localhost/windows/winter.jpg",
"winter","width=1150,height=350,resizable=yes,
scrollbars=yes,location=yes");
3
winObj.focus();
4
//winObj.blur();
}
5
function closeWindow(){
6
winObj.close();
}
</script>
</head>
<body bgColor="lightblue">
<h2>Winter Scene from the Old Country</h2>
<h3>Click the link to see my winter window<br />
7
<a href="JavaScript:newWindow()">Winter Scene</a>
<p>When you are ready to close the window, click here<br />
8
<a href="JavaScript:closeWindow()">Close the window</a></h3>
</body>
</html>
 
Search WWH ::




Custom Search