Business
Jobs
  • About Us
  • Solutions
    • Job Postings
      Post your job and receive qualified candidates in 48h.
    • Candidate Assessments
      500+ technical and psychological tests, plus anti-fraud.
    • Headhunting
      Tailor-made executive search from start to finish.
    • Payroll + EOR
      Payroll dispersal and EOR across 15+ LATAM countries.
  • Pricing
  • Jobs

0

208
Views
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
Answer question
Find remote jobs

Discover the new way to find a job!

Top jobs
Top job categories
Business
Post vacancy Pricing Sales
Legal
Terms and conditions Privacy policy
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Show me some job opportunities
There's an error!