Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Save scroll position in navigation history #30

Closed
madaboutbrighton opened this issue Oct 14, 2014 · 4 comments
Closed

Save scroll position in navigation history #30

madaboutbrighton opened this issue Oct 14, 2014 · 4 comments

Comments

@madaboutbrighton
Copy link

Great project! You have a scroll option, which is useful for when NEW content is loaded.

However, if i do the following:

  • visited a link
  • scrolled down the page
  • clicked on a new link
  • viewed the new page
  • hit the back button

I am taken to the top of the page again. So i have to scroll all the way back down, trying to find where i was before.

When i click a link, can pjax not record my scroll position before loading the new content, then when i go back to a page, take me back to the same scroll position?

This would be very helpful.

Thanks very much.

@MoOx
Copy link
Owner

MoOx commented Oct 14, 2014

This will require some effort but this should be doable.
But I won't focus on that right now since I've lot of others stuff to finish.

@MoOx MoOx changed the title Remember scroll position and return to it Save scroll position in navigation history Oct 14, 2014
@darylteo
Copy link
Collaborator

darylteo commented Jan 5, 2016

I believe #40 is related to this.

@BehindTheMath
Copy link
Collaborator

@MoOx Would it be possible to implement this by storing the scroll position along with the state when calling pushState()?

@MoOx
Copy link
Owner

MoOx commented Dec 21, 2017

Probably?

BehindTheMath added a commit that referenced this issue Jan 22, 2018
Save scroll position when navigating away from a page, and restore
it when navigating back to that page.

Fixes #30.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

4 participants