caffxxnx Posted March 10, 2021 Share Posted March 10, 2021 Hi all, I'm new for GSAP and have start building projects with it. As building those, I found 2 questions wondering. The demo I made is simulating following situation: Users go to other page after scrolling to section 2, then come back to this page.( so the page leave on section 2 first) Then call setScrollEffect() because I want the ScrollTrigger effects back. As result, after calling the function, scroller jump back to section 1, which is not I expected. What I expected is users seeing the section where they leave. Is there any suggestion? If there's any confusion, please let me know. I'll try my best to explain. Thank you for reading and helping. See the Pen jOVQKvd?editors=0010 by caffxxnx (@caffxxnx) on CodePen Link to comment Share on other sites More sharing options...
akapowl Posted March 10, 2021 Share Posted March 10, 2021 Hey @caffxxnx - welcome to the forums. This following thread contains one possible solution, using a variable with a boolean value to check wether or not your page is still setting up - and only if the page is not setting up triggering the move to another section inside of the ScrollTriggers' callbacks. Give it a try and let us know if it helps. 2 Link to comment Share on other sites More sharing options...
caffxxnx Posted March 11, 2021 Author Share Posted March 11, 2021 Hi @akapowl, The solution work perfectly! Thank you very much for answering! 1 Link to comment Share on other sites More sharing options...
Recommended Posts
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 accountSign in
Already have an account? Sign in here.
Sign In Now