Click to See Complete Forum and Search --> : IE moveTo() problem


goofball
05-07-2003, 12:09 PM
Any help / suggestions appreciated:

I can't find a way to access the OUTER screen coordinates of a browser window in IE 6. Using window.screenLeft / screenRight gets the coordinates of the "document window," which is inside the outter border of the browser window.

It's no problem with Netscape 6 - you just use screenX and screenY. Is there an equivilant in IE?

khalidali63
05-07-2003, 12:49 PM
for NS

window.screenX;
window.screenY;

and for IE

window.screenLeft
window.screenTop

goofball
05-07-2003, 12:59 PM
Thanks, but no - I already tried that. (My mistake putting "screenRight" in the original post).

As I mentioned, the IE properties:
window.screenLeft and
window.screenTop

give the coordinates for the document area inside the window. I'm looking for the coordinates of the OUTside of the browser window. I know it seems like those properties should work for that purpose, but they don't (at least not on my browser).

Try this code in a smiple HTML page, and you'll see what I mean:

<html>
<head>
<script language="JavaScript">
function move() {
window.moveTo(window.screenLeft,window.screenTop);
}
</script>
</head>

<body bgcolor="#FFFFFF" text="#000000">
<a href="javascript:move();">Move window</a>
</body>
</html>

------ This file is attached -------

You'll see that when you click the link, the IE browser will jump down and to the right. I need the coordinates that will "move" the window to the same position it's already in when I click the link.

Thanks for your time!

Jona
05-07-2003, 02:35 PM
In IE, use screen.X and screen.Y

Edit: I could be wrong on that one. If that doesn't work, try screen.width and screen.height.

goofball
05-07-2003, 02:43 PM
nope

screen.X and screen.Y in IE are 'undefined'

screen.width and screen.height
are the width and height of your monitor in pixels, not the coordinates of the browser window.

Jona
05-07-2003, 02:45 PM
Oh, I see. Try using screen.height - window.screenTop

khalidali63
05-07-2003, 05:44 PM
Originally posted by goofball
Any help / suggestions appreciated:

I can't find a way to access the OUTER screen coordinates of a browser window in IE 6.

Here is what MS has to say about it.

screenLeft Retrieves the x-coordinate of the upper left-hand corner of the browser's client area, relative to the upper left-hand corner of the screen.
screenTop Retrieves the y-coordinate of the top corner of the browser's client area, relative to the top corner of the screen.

thats crappy..