After launching the app and scroll the page. When navigating from one screen to another through button action, when trying to keep the vertical scroll position of the page on button action using $(window).scrollTop()
it always has given 0 on iOS platform whereas, on Android, it works fine.
If navigating to the second screen and come back to the same screen and then trying to get the value of $(window).scrollTop()
it has given the correct value.
Asked
Active
Viewed 226 times
0

Sachin Kumaram
- 900
- 1
- 10
- 27
-
Webkit bug. Try `$(body).scrollTop()` instead. – peeebeee Aug 20 '18 at 10:18
-
1Possible duplicate of [scrollTop always returns 0](https://stackoverflow.com/questions/36227559/scrolltop-always-returns-0) – peeebeee Aug 20 '18 at 10:18
-
@peeebeee I already try $(body).scrollTop(), but still the same issue. – Sachin Kumaram Aug 20 '18 at 10:28
-
That answers for https://stackoverflow.com/questions/36227559/scrolltop-always-returns-0 is different, but I also try to resolve with this help, but it doesn't work here. – Sachin Kumaram Aug 20 '18 at 15:08