Click to See Complete Forum and Search --> : Obtain current window's position (top,left)


bdavid
08-19-2003, 09:31 PM
I want to open a popup window in relation to the window currently viewed, INSTEAD of the screen's origin (0,0).

So I need to find out the x,y position of the upper-left corner of the window, in relation to the screen's origin.

Is there something like:

x = window.position.x
y = window.position.y

or

x = self.position.x
y = self.position.y

Khalid Ali
08-19-2003, 11:34 PM
var winX = (document.all)?window.screenLeft:window.screenX;

var winY = (document.all)?window.screenTop:window.screenY;

The above will get you what you want for both IE and NS

bdavid
08-20-2003, 08:29 AM
Thank you very much, it did indeed solve my problem.