Jump to content
Search Community

ScrollTrigger with option ‘once’ set doesn’t work if scrolling up Initially

Code32 test
Moderator Tag

Recommended Posts

When setting once: true, on the scroll trigger animation and loading a page while scrolled down to the bottom, the animations don’t run when scrolling upwards.

 

I expected once to work either way but only once, not just when scrolling downwards. Can somebody help explain whether there’s another way of doing this or if it’s a bug?

 

thanks,

mike

Link to comment
Share on other sites

Hey Mike and welcome to the GreenSock forums. 

 

You're right that once: true makes the animation associated with a ScrollTrigger only fire in the onEnter and nothing else. That's intended. 

 

To do what you're attempting to you I'd disable the ScrollTrigger in the onLeaveBack callback:

See the Pen YzwzYgp?editors=0010 by GreenSock (@GreenSock) on CodePen

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...