Jump to content
Search Community

Add ScrollTrigger timing questions

caffxxnx test
Moderator Tag

Recommended Posts

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

  • caffxxnx changed the title to Add ScrollTrigger timing questions

 

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.

 

  • Like 2
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...