搜索 | 用户支持

防范以用户支持为名的诈骗。我们绝对不会要求您拨打电话或发送短信,及提供任何个人信息。请使用“举报滥用”选项报告涉及违规的行为。

详细了解

window.pageXOffset and window.pageYOffset not working anymore

more options

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

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

所有回复 (3)

more options

I have not heard of this being removed. Is there a sample page which demonstrates the problem?

more options

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

more options

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.