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

214
Vistas
window.screenY in mobile devices is always zero on Webkit (Chrome, Safari) but works on Gecko (Firefox)

Problem

window.screenY always returns 0 on Safari and Chrome (Android and iOS).

I need to know the vertical position of the viewport in compare to the screen, on mobile devices, in browser.

Per MDN, Window.screenY should return it. It works fine on Firefox, but not on Chrome (Android or iOS) or Safari (iOS). I filed a bug on WebKit (https://bugs.webkit.org/show_bug.cgi?id=234256), but I wanted to see if anyone else has faced this or has any solution.

Hacky partial solution

I can get this by subtracting clientY from screenY on a touch/click event. But I want this is general.

Original problem

I have an element that I want to attach to the bottom of the window, but not all the way to the bottom of the screen. i.e. on Android's 3-button menus, the padding that gives to the bottom of the screen is great. However, with the Gesture Navigation on android, there is no bottom padding padding between the window and the screen.

enter image description here

I found no way to detect whether the use has "3-button Navigation buttons" or "Gestures Navigation". I am hoping to guess that by subtracting the screenY from window.screen.availHeight - window.innerHeight to get the equivalent of screenY for the bottom. (bottom padding between the window and the screen.)

about 4 years ago · Juan Pablo Isaza
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