Jump to content
Search Community

keep Scroll to the old position.

Adesh test
Moderator Tag

Recommended Posts

It looks like you're using a 3rd party scrolling library that's interfering with things most likely. We can't really support non-GreenSock products. I'd encourage you to first eliminate that 3rd party library from your project and see if it resolves things. If so, you know that's the culprit and you can contact the author to seek advice. 

 

You may also want to try explicitly setting the scrollRestoration value in the browser: 

if (history.scrollRestoration) {
  history.scrollRestoration = 'manual';
}

 

Link to comment
Share on other sites

Hi,

 

GreenSock has the ScrollSmoother plugin for this:

https://greensock.com/scrollsmoother/

 

What you can do with your current setup is to store in the browser's Local Storage the scroll position when the page is refreshed and check if that position is defined when loaded and apply that. But as mentioned before this is related to a third party library so you should check their API in order to do that.

 

https://developer.mozilla.org/en-US/docs/Web/API/Window/localStorage

https://developer.mozilla.org/en-US/docs/Web/API/Storage

 

Happy Tweening!

  • Like 1
Link to comment
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...