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.

Syntax

JSV_getWindowDimensions(expWH, expWD)

Returns

Returns an x,y object (see JSV_xyValues) containing the the inner and outer window dimensions of the browser window.

Parameters

The JSV_getWindowDimensions function uses the following arguments.

Argument Description
expWH The window handle—the 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.)

Remarks

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.

Dependencies

n/a

Example

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:

  1. Click the Create Window button to open the test window.
  2. Manually resize the window and move it to a different part of the screen.
  3. Click the Get Window Dimensions button to get the new dimensions of the screen.