Tìm kiếm hỗ trợ

Tránh các lừa đảo về hỗ trợ. Chúng tôi sẽ không bao giờ yêu cầu bạn gọi hoặc nhắn tin đến số điện thoại hoặc chia sẻ thông tin cá nhân. Vui lòng báo cáo hoạt động đáng ngờ bằng cách sử dụng tùy chọn "Báo cáo lạm dụng".

Tìm hiểu thêm

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

Tất cả các câu trả lời (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.