Just discovered a small bug/feature with the Android browser.
If you scroll the page down and then reload it, the window.pageYOffset value will not be equal to 0!
Here's a simple example: http://pastebin.com/bHzc5Ymi
To reproduce:
- Copy this code and open the page on any Android device
- If there is no scrollbar, click the 'Show hidden content' link to load more text :)
- Scroll down in the browser's window
- Click 'Reload' to refresh the page
Below the heading, you can see the initial value of window.pageYOffset
. It will be > 0 on Android devices :(
Does anyone know how to reset the initial pageYOffset
value on Android?