Code32 Posted June 3, 2020 Share Posted June 3, 2020 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 More sharing options...
kohlej Posted June 3, 2020 Share Posted June 3, 2020 Hi Mike, you want the tween to be played when element enters the viewport both way? You can use toggleActions, everything is explain in their scrollTrigger video.https://greensock.com/docs/v3/Plugins/ScrollTrigger 2 Link to comment Share on other sites More sharing options...
Code32 Posted June 3, 2020 Author Share Posted June 3, 2020 Hey, thanks for the response. Yeah both ways, but only once when it enters. I don't want the animations playing again if they re-enter. I'll take another look at the docs. Link to comment Share on other sites More sharing options...
ZachSaucier Posted June 3, 2020 Share Posted June 3, 2020 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 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