See also: JSV_windowCenter, JSV_getWindowDimensions, JSV_xyValues |
Determines the difference between the inner browser window dimensions and the known outer dimensions of the browser window.
JSV_getWindowDeltas(expX, expY | expXY, expWH)
Returns an x,y object (see JSV_xyValues) containing the difference between the inner window dimensions and the outer dimensions of the browser window.
The JSV_getWindowDeltas function uses the following arguments.
Argument | Description |
expXY | The x,y object (see JSV_xyValues) that contains the width and height, respectively, of the window to be centered. |
expX, expY | The width (expX) and height (expY) of the window to be centered. |
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. |
This function is for use with browsers that support JavaScript 1.2 or later.
The best time to use this function is right after you create a new browser
window (e.g., when using
JSV_popWindow,
JSV_openWindow, or the
open
method of window
).
innerWidth
and innerHeight
) browser window
dimensions and the known outer dimensions of the browser window,
i.e., the expX
and expY
, or expXY
,
arguments passed to the function. If the windw is resized,
then obtain the inner width and height and add the deltas to obtain the
outer width and height of the browser window.outerWidth
and
outerHeight
of the browser window.
Calling this function in a Netscape browser returns x and y values of zero.
For more information on the use of JSV_getWindowDeltas, 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=580,height=240,' +
'left=40,top=40,screenX=40,screenY=40';
var myXY = new JSV_xyValues(580,240);
var jsvWindowDeltas = new JSV_xyValues();
function windowTest() {
myWindowHandle = JSV_popWindow( myWindowHandle,
myWindow,
'JSV_TestWindow.html',
myAttributes,
false);
jsvWindowDeltas = JSV_getWindowDeltas(myXY, myWindowHandle);
alert("x delta = " + jsvWindowDeltas.x + "\n" + "y delta = " + jsvWindowDeltas.y);
myWindowHandle.focus();
}
produce
Copyright © 2000 Roaring Fork Software. All rights reserved.