Hello and welcome to our community! Is this your first visit?
Register
Enjoy an ad free experience by logging in. Not a member yet? Register.
Results 1 to 2 of 2
  1. #1
    New Coder
    Join Date
    Sep 2005
    Posts
    68
    Thanks
    0
    Thanked 0 Times in 0 Posts

    element position in firefox from top of screen

    I've been trying to get the x,y coordinates of an element from the top of the viewing area. So far I've tried looping through the parents of the element and getting their "offsetTop" and adding all of those together. However, this always gives me the same number no matter where my element is.

    Does anyone know a sure way to get the position of an element in firefox?

    Thanks.

  • #2
    Regular Coder
    Join Date
    Aug 2005
    Location
    Toronto, ON, Canada
    Posts
    231
    Thanks
    0
    Thanked 0 Times in 0 Posts
    DOM Inspector Ctrl+Shift+I

    position of the FF window on the screen:
    HTMLDocument.defaultView.screenX
    rm -f /


  •  

    Posting Permissions

    • You may not post new threads
    • You may not post replies
    • You may not post attachments
    • You may not edit your posts
    •