How to determine the relative position of an element?

Discussion in 'Javascript' started by delerious@no.spam.com, Dec 7, 2003.

  1. Guest

    I know how to figure out the top coordinate of an element relative to the top
    of the document. I can use one of the following:

    - document.defaultView.getComputedStyle(document.getElementById(element_id),
    '').getPropertyValue('top')

    - document.getElementById(element_id).offsetTop

    But I don't know how to determine the top coordinate of an element relative to
    the top of the viewable area of the browser. Does anyone know how to do this
    (in IE, Opera, and Mozilla)?
     
    , Dec 7, 2003
    #1
    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. Luqman
    Replies:
    1
    Views:
    659
    Luqman
    Feb 7, 2006
  2. Gelonida
    Replies:
    0
    Views:
    592
    Gelonida
    Feb 19, 2011
  3. pardesiya

    How to determine TreeView SelectedNode relative position

    pardesiya, May 11, 2007, in forum: ASP .Net Web Controls
    Replies:
    1
    Views:
    233
    pardesiya
    May 11, 2007
  4. Stephan Koser

    Absolute position of a relative element

    Stephan Koser, Jun 14, 2004, in forum: Javascript
    Replies:
    7
    Views:
    141
    Mike Foster
    Jun 18, 2004
  5. Replies:
    2
    Views:
    115
    Michael Winter
    Mar 18, 2006
Loading...

Share This Page