Empresas
Empleos
  • Sobre nosotros
  • Soluciones
    • Publicación de vacantes
      Publica tu vacante y recibe candidatos calificados en 48h.
    • Evaluación de candidatos
      500+ pruebas técnicas y psicológicas, más anti-fraude.
    • Headhunting
      Búsqueda ejecutiva a la medida de principio a fin.
    • Nómina + EOR
      Dispersión de nómina y EOR en más de 15 países de LATAM.
  • Precios
  • Empleos

0

297
Vistas
JavaScript - get document (window) position relative to the browser window (or the screen)

Is there a way to get the position of the page / document (inner window) relative to the browser window?

For instance, there are properties on the window object like innerWidth / outerWidth which allow to get the width of the document renderer and width of the browser window respectively.

I could not find any properties that could determine position of the document within browser window. There's screenX, but it's position of the browser window relative to the screen.

Note that what affects the document position the most is devTools, which can be attached to either left, bottom or right edge of the screen. Also some browsers have sidebars. So it's not as simple as assuming that the docX relative to the window is 0 and docY = outerHeight - innerHeight

Is there any API available to get it?

Edit:

Example: Let's say the browser's tab and addressbar UI at the top is 150px in height and there's a sidebar to the left that has width of 200px. The position would be (200px,150px)

about 4 years ago · Juan Pablo Isaza
1 Respuestas
Responde la pregunta

0

At this point the only solution found so far is using UIAutomation AutomationElement to get the object from the browser and grab top left from that.

I'm looking for a purely javascript implementation to get the browser top level document x,y relative to the screen.

The last version of GetAbsCoordinates in answers here: Get On-Screen Location of ...

about 4 years ago · Juan Pablo Isaza Denunciar
Responde la pregunta
Encuentra empleos remotos

¡Descubre la nueva forma de encontrar empleo!

Top de empleos
Top categorías de empleo
Empresas
Publicar vacante Precios Comercial
Legal
Términos y condiciones Política de privacidad
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Recomiéndame algunas ofertas
Necesito ayuda