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

Discussion in 'Javascript' started by igpig@yahoo.com, May 4, 2007.

  1. Guest

    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.
    , May 4, 2007
    #1
    1. Advertising

  2. Guest

    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.
    , May 4, 2007
    #2
    1. Advertising

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

It takes just 2 minutes to sign up (and it's free!). Just click the sign up button to choose a username and then you can ask your own questions on the forum.
Similar Threads
  1. Suresh  Kumar
    Replies:
    0
    Views:
    589
    Suresh Kumar
    Jul 3, 2003
  2. LaurieRQHR

    objects default to top left corner when adding to templates

    LaurieRQHR, Apr 11, 2007, in forum: ASP .Net Web Controls
    Replies:
    0
    Views:
    139
    LaurieRQHR
    Apr 11, 2007
  3. JimFurrow
    Replies:
    1
    Views:
    98
  4. Michael
    Replies:
    1
    Views:
    155
  5. Replies:
    3
    Views:
    91
Loading...

Share This Page