home / experts / javascript / tutorial1 |
|
Window FeaturesThe basic structure of the
However, you can customize your new windows by using two additional arguments:
You can use the default features by omitting these arguments. Let's start with with the The third argument of the
This statement opens a resizable window with a Location field and a menu bar. All other features are turned off. For example, the new window doesn't feature a status bar, because we didn't specify the
Many of the features can either be yes or no. For these features, you can use 1 instead of yes and 0 instead of no. If you want to turn a feature on, you can also simply list the feature name in the sFeatures string. If you don't list a specific feature, it is turned off (except titlebar and hotkeys). The sFeatures argument is a comma-separated list of features. It should not contain any spaces or other whitespace. Each element in the list should have the format:
There is a big difference between assigning the As mentioned in the previous section of this tutorial, the second argument of the Not all window features are supported by all browsers. If the browser doesn't recognize a specific feature, it simply ignores it. Let's take a look at JavaScript's various window features:
alwaysLowered
Specifies that the window should always remain at the bottom of the stack. In other words, the new window should float below other windows, whether it is active or not. This feature requires a signed script.
alwaysRaised
Specifies that the window should always remain at the top of the stack. In other words, the new window should float above other windows, whether it is active or not. This feature requires a signed script.
channelmode
Specifies whether to display the window in theater mode and show the channel band.
dependent
Specifies whether the window should be a dependent child of the current (opener) window. A dependent window closes when its parent window closes. On Windows platforms, a dependent window does not show on the task bar.
directories
Specifies whether to display directory buttons (best known as the "What's Cool" and "What's New" buttons). Internet Explorer refers to the directory buttons as the Links Toolbar, while Navigator (4 and above) calls them the Personal Toolbar.
fullscreen
Specifies whether to display the browser in a full-screen window. Use full-screen mode carefully. Because this mode hides the browser's title bar and menus, you should always provide a button or other visual clue to help the user close the window. ALT+F4 also closes the new window.
height
Specifies the height, in pixels, of the window's document display area. The minimum value is 100 (Navigator allows lower values in signed scripts). If only the height is specified, Internet Explorer uses the given height and the default width. Navigator simply ignores this property if you don't specify
hotkeys
If
innerHeight
Specifies the height, in pixels, of the window's document display area. The minimum value is 100 (Navigator allows lower values in signed scripts). This feature replaces
innerWidth
Specifies the width, in pixels, of the window's document display area. The minimum value is 100 (Navigator allows lower values in signed scripts). This feature replaces
left
Specifies the X-coordinate, in pixels, of the window.
location
Specifies whether to display the input field for entering URLs directly into the browser.
menubar
Specifies whether to display the menu bar (the menu at the top of the window, including File and Edit).
outerHeight
Specifies the total height, in pixels, of the window (its outside boundary). The minimum value is a little more than 100, because the height of the window's content area must be at least 100 (Navigator allows lower values in signed scripts). Navigator simply ignores this property if you don't specify
outerWidth
Specifies the total width, in pixels, of the window (its outside boundary). The minimum value is a little more than 100, because the width of the window's content area must be at least 100 (Navigator allows lower values in signed scripts). Navigator simply ignores this property if you don't specify
resizable
Specifies whether the window should have resize handles around its border. Depending on the platform, the user may still have ways to resize the window.
screenX
Specifies the X-coordinate, in pixels, of the window.
screenY
Specifies the Y-coordinate, in pixels, of the window.
scrollbars
Specifies whether to enable horizontal and vertical scrollbars when they are necessary.
status
Specifies whether to add a status bar at the bottom of the window.
titlebar
Specifies whether to display a title bar for the window. In Internet Explorer, this feature is ignored unless the caller is an HTML Application or a trusted dialog box. In Navigator, setting this feature to
toolbar
Specifies whether to display the browser toolbar (the toolbar at the top of the window, including Back and Forward).
top
Specifies the Y-coordinate, in pixels, of the window.
width
Specifies the width, in pixels, of the window's document display area. The minimum value is 100 (Navigator allows lower values in signed scripts). If only the width is specified, Internet Explorer uses the given width and the default height. Navigator simply ignores this property if you don't specify
z-lock
Specifies that the window should not be raised in the stacking order when activated. In other words, the new window should does not rise above other windows when activated. This feature requires a signed script.
Next: How to utilize the window features |
Produced by Yehuda Shiran and Tomer Shiran
| ||||||||||||||||||||
Created: April 10, 2000
Revised: April 10, 2000
URL: http://www.webreference.com/js/tutorial1/features.html