asp.net.ph

Skip Navigation Links

moveBy Method

DHTML Methods


Moves the screen position of the window by the specified x- and y-offsets relative to its current position.

Syntax

object.moveBy ( iX, iY ) 
Parameters

iX Required. Horizontal scroll offset, in pixels.
iY Required. Vertical scroll offset, in pixels.

Return Value

No return value.

Remarks

When you open a window you can with IE set left and top in the feature string, and with NN set screenX and screenY, so together you can for example write:

window.open ( 'whatever.html', 'windowName', 
  'left=100, screenX=100, top=100, screenY=100' ) 

where you can of course add further features like width, height, scrollbars, menubar, etc.

Once a window is open, you can move it calling the moveTo or moveBy methods of the window object:

var win = open ( 'whatever.html', 'windowName' );
win.moveBy ( 20, 20 );

To retrieve the current coordinates of a window, for IE, use:

window.screenLeft
window.screenTop

and for NN:

window.screenX
window.screenY
Applies To

window



© 2025 Reynald Nuñez and asp.net.ph. All rights reserved.

If you have any question, comment or suggestion
about this site, please send us a note