Hi Ellen,
Here is a code to get and store scroll:
pre
self.storedScrollTop = jQuery(window).scrollTop();
/pre
And here is code to restore scroll from stored value:
pre
jQuery(window).scrollTop(self.storedScrollTop);
/pre
Regards.
Hi Ellen,
Here is a code to get and store scroll:
pre
self.storedScrollTop = jQuery(window).scrollTop();
/pre
And here is code to restore scroll from stored value:
pre
jQuery(window).scrollTop(self.storedScrollTop);
/pre
Regards.
The update service happens on a different page so I tried the first code when you navigate to that page then the second code when I come back to the first page but it didn't work.
Hi Ellen,
You need:
On page show(for goal page) store scroll.
On service "complete" event handler - restore scroll.
Regards.
The problem is with #2. I can't run that code on a service completion that is on a different page.
Hi Ellen,
These two things should be done on the one page.
Before invoke service.
After complete service.
Regards.
I don't think you understand.
A user clicks an item from a very long list and they go to another page. When they come back, I want the scroll position to be in the same spot as it was before. To have it after the service is complete, it could be on the wrong page.
Hi Ellen,
When they comeback - list on the correct position(before you reload it)? Cause of if list not on the same position like on was when you click on item how do you want to reinit just one item?
If your list on the same(goal) position you can implement it in way described above.
Regards.
I ran the first code when a user clicks on the list item to navigate away. I then ran the second code when the user comes back and it didn't work.