x, y coordinates of the browser top left corner in Interenet Explorer.

I

igpig

Sorry if this has been asked before. I've searched the group and the
FAQ and didn't find the answer.

How can I retrieve x, y coordinates of the browser top left corner in
Internet Explorer?

In Firefox screenX/screenY are working as expected.

In IE, from MSDN :
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.

So, screenTop will include titlebar height as well. Using that in
window.open will shift the window down.
 
I

igpig

One possibility (from http://www.webmasterworld.com/javascript/3236180.htm)
is to do something like this:

if(self.innerHeight){
hdiff = self.screen.availHeight - self.innerHeight;
wdiff = self.screen.availWidth - self.innerWidth;
} else {
hdiff = self.screen.availHeight -
document.documentElement.offsetHeight;
wdiff = self.screen.availWidth -
document.documentElement.offsetWidth;
}

and then to adjust screenLeft/screenTop when creating a popup.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

No members online now.

Forum statistics

Threads
473,744
Messages
2,569,483
Members
44,901
Latest member
Noble71S45

Latest Threads

Top