window.pageXOffset and window.pageYOffset not working anymore
Hi,
in earlier firefox versions window.pageXOffset gave the correct value from the left border of the website to the scrolled left screen border in pixels. After the last Update it doesn't matter where I move my screen to, it always says zero.
Is the feature removed or a bug? If it's removed, how I can get the window position relative to the viewport for javascript?
Firefox Version on Android: 63.0.2 last Update: 07.11.2018
Greetings,
Udo
Všechny odpovědi (3)
I have not heard of this being removed. Is there a sample page which demonstrates the problem?
Hi,
go to the Page:
https://ubxd.de/test/firefox_problem.php
there is a simple div Box. If you click the Box, the values of window.pageXOffset and window.pageYOffset gets shown inside the box.
If you open the site in Firefox for PC and make the window smaller that you can scroll the box, the values changing if you scroll to the right or down and press the box again.
If you open the site in Firefox for Android, no matter where the viewport is, it always shows zero. In earlier Versions of Firefox it had the same behavior like Firefox on PC and shows the correct Distance of the site window to the viewport borders.
LG,
Udo
Thanks, Udo. It seems to behave very inconsistently. After I zoom into the page so some scrolling is needed, it may or may not show me new values as I move the rectangle around and tap. Seems sometimes the horizontal gets stuck on 0 until I do a little vertical scrolling, then it starts working. I don't know why it is behaving that way.