See also: JSV_windowCenter, JSV_getWindowDeltas, JSV_xyValues |
Returns an x,y object (see JSV_xyValues) containing the outer width and height of the browser window.
JSV_getWindowDimensions(expWH, expWD)
Returns an x,y object (see JSV_xyValues) containing the the inner and outer window dimensions of the browser window.
The JSV_getWindowDimensions function uses the following arguments.
Argument | Description |
expWH | The window handlethe result of the open() method that is a reference or handle to the newly opened window and used to close the window, and to interrogate and alter the windows properties. |
expWD | The x,y object (see JSV_xyValues) that contains the window deltas (i.e., difference between the inner window dimensions and the outer dimensions of the browser window). (See JSV_getWindowDeltas.) |
This function is for use with browsers that support JavaScript 1.2 or later.
For Netscape Navigator, this can be x,y = 0,0 since
Netscape provides the outerWidth
and
outerHeight
of the browser window.
(See JSV_getWindowDeltas.)
For more information on the use of JSV_getWindowDimensions, see JavaScript Vision Frequently Asked Questions.
n/a
The following lines of code
var myWindowHandle = null;
var myWindow = "JSV_Test";
var myAttributes = 'status=1,scrollbars=1,resizable=1,' +
'width=300,height=150,' +
'left=40,top=40,screenX=40,screenY=40';
var myXY = new JSV_xyValues(300,150);
var jsvWindowDeltas = new JSV_xyValues();
function windowTest() {
myWindowHandle = JSV_popWindow( myWindowHandle,
myWindow,
'JSV_TestWindow.html',
myAttributes,
false);
jsvWindowDeltas = JSV_getWindowDeltas(myXY, myWindowHandle);
var myWinDim = JSV_getWindowDimensions(myWindowHandle, jsvWindowDeltas);
alert("width = " + myWinDim.x + "\n" + "height = " + myWinDim.y);
myWindowHandle.focus();
}
produce
Window Dimension Test:
Copyright © 2000 Roaring Fork Software. All rights reserved.