Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • Home
  • SEARCH
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 8064329
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 5, 20262026-06-05T11:20:05+00:00 2026-06-05T11:20:05+00:00

I need to get absolute coordinates (left and top relative to beginning of document)

  • 0

I need to get absolute coordinates (left and top relative to beginning of document) of any DOM element inspected by Firebug regardless depth of DOM tree. Is there such a plugin?

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-05T11:20:07+00:00Added an answer on June 5, 2026 at 11:20 am

    You don’t need a plugin in fact, just a chunk of JavaScript + knowledge of some Firebug internals.

    You can find in this article how to get absolute coords of a DOM element. Each DOM element has properties .offsetLeft .offsetTop .offsetParent that define the position regarding some other DOM element (the offsetParent). The element on the top of hierarchy has a offsetParent = null. You can traverse the elements and its offsetParents up the hierarchy to find the absolute coords, given an element.

    The code copied from that page:

    var findpos = function findPos(obj) {
       var curleft = curtop = 0;
       if (obj.offsetParent) {
          do {
          curleft += obj.offsetLeft;
          curtop += obj.offsetTop;
          } while (obj = obj.offsetParent);
          return [curleft,curtop];
       }
    }
    

    (paste it in Firebug, and then you have a findpos function available in the console).

    For majority of simplest cases, you will have offsetParent = <body> which has zero offsets (like in the screenshots) so you don’t need to add anything to offsetLeft and offsetTop. However if relative positionings take place, then you must traverse the parents.

    When you select an element in Firebug, then it’s available as $0 in Firebug console.

    So, after mixing the two things, you can issue the commands like in the screenshot:

    Firebug - finding absolute coords of a node

    to easily get absolute coords of any element.

    The script I’ve pasted above should work in the huge majority of occasions. You may want to read this post also for a bit more robust function.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I need to get a hold of the absolute mouse position / coordinates (X
How do I get the absolute or site-relative path for an included javascript file.
I need to get an absolute file path into the native AIR browser. I've
I have a div that has a relative position but I need to get
Is there any way to get pyramid absolute application url in main() function? I
I need to get the absolute path of the assets folder in my app
I have an absolute positioned div that I need to get to to fill
I need to get the absolute of the signal in Xilinx Simulink. I can
I need to get Absolute path to Folder in Assets. Some like this for
I need to get a file name from file's absolute path (I am aware

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.