page element - absolute position

Discussion in 'ASP .Net' started by Microsoft Newsserver, Apr 18, 2008.

  1. Im using IE 6/7 / ASP.NET / Javascript.

    I need to determine the absolute position of elements on my page client
    side. In summart, I need to know if an event triggered mouse position
    appears inside a div.

    Now the rub is that some divs may be absolutely positioned and some may be
    positioned relatively. I know I can get the position of the mouse using
    event.clientX or clientY.

    But when determining the absolute position of an element, im stumped I know
    I can use offet.Left, but if the element is nested then does this mean I
    have to keep goinfg up the parent hierarchy until I reach the body to find
    its position or is there a simpluer way, Im sure there is >

    Thanks.
     
    Microsoft Newsserver, Apr 18, 2008
    #1
    1. Advertisements

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:
    833
    Luqman
    Feb 7, 2006
  2. Konrad Hammerer
    Replies:
    14
    Views:
    816
    Jonathan N. Little
    Feb 7, 2008
  3. James Byrne
    Replies:
    3
    Views:
    899
    James Byrne
    Sep 14, 2010
  4. Chris Leonard

    How to get the absolute position of an element

    Chris Leonard, Aug 31, 2003, in forum: Javascript
    Replies:
    5
    Views:
    218
    Chris Leonard
    Sep 2, 2003
  5. Stephan Koser

    Absolute position of a relative element

    Stephan Koser, Jun 14, 2004, in forum: Javascript
    Replies:
    7
    Views:
    300
    Mike Foster
    Jun 18, 2004
  6. Knut
    Replies:
    1
    Views:
    277
    George Hester
    Oct 15, 2004
  7. Replies:
    1
    Views:
    111
  8. Pugi!
    Replies:
    10
    Views:
    400
    Randy Webb
    Dec 19, 2006
Loading...