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. 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:
    680
    Luqman
    Feb 7, 2006
  2. Chris Leonard

    How to get the absolute position of an element

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

    Absolute position of a relative element

    Stephan Koser, Jun 14, 2004, in forum: Javascript
    Replies:
    7
    Views:
    157
    Mike Foster
    Jun 18, 2004
  4. Knut
    Replies:
    1
    Views:
    158
    George Hester
    Oct 15, 2004
  5. Pugi!
    Replies:
    10
    Views:
    219
    Randy Webb
    Dec 19, 2006
Loading...

Share This Page