Jump to content
Search Community

Animation Play Once

Bobby80 test
Moderator Tag

Recommended Posts

Welcome to the forums, @Bobby80. The key is in your "toggleActions". Currently you have: 

toggleActions: "restart pause resume reverse",

Which means "restart every time it enters, pause when it leaves, resume when it enters back onto the screen scrolling the opposite way, and reverse when it leaves the screen while scrolling the opposite way". See the ScrollTrigger docs to read more about toggleActions

 

But if you just want it to play when it enters the screen, do this: 

toggleActions: "play none none none",

Which is actually the default, so you could even remove the toggleActions completely and it'll do the same thing. :)

 

Happy tweening!

  • Like 2
Link to comment
Share on other sites

What do you mean by it only plays intermittently?

 

Just going on the demo you posted above, you probably shouldn't be recreating your ScrollTrigger on refresh. Every time the address bar moves in and out view, it will trigger a refresh because the size is being resized.

 

ScrollTrigger.addEventListener("refresh", setupSplits);

 

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