I have a single page application built in Phonegap and I had been having problems with iOS device (not android) whilst using:
document.querySelector('page').scrollTop = 0;
If i navigate to a different page and the view I just came from had scrollTop //38
it would keep the same scrollTop //38
as I only changed content inside of page
.
So I would use the above jS
to edit the scroll top, so doing this:
document.querySelector('page').scrollTop //outputs 38
Fantastic, however when i touch the screen it would jump down 38px
and resetting scrollTop = 38
.
If i remove
page {
-webkit-overflow-scrolling: touch;
}
Then this problem would no longer occur, but also smooth scrolling would stop and would only scroll so long as your were touching the screen.
Does anybody now how I can use scrollTop
correctly whilst keeping this sliding effect natively active?