Jump to content
Search Community

Error when using toggleActions

MarcoCuel

Go to solution Solved by Rodrigo,

Recommended Posts

Posted

Hello everyone, I hope you are all well.

I have a problem after trying to use toggleAction, this error appears in the console

"Invalid property" "toggleActions" "set to" "play pause resume reset" "Missing plugin? gsap.registerPlugin()"

 

 

See the Pen yyLgVOq?editors=1011a by MarcoCuel (@MarcoCuel) on CodePen.

  • Solution
Posted

Hi,

 

The toggleActions option should be inside the ScrollTrigger config object, not in a Tween/Timeline's config object:

// Wrong
gsap.to(target, {
  x: 200,
  toggleActions: "play pause resume reset",
});

// Right
gsap.to(target, {
  x: 200,
  scrollTrigger: {
    toggleActions: "play pause resume reset",
  },
});

https://gsap.com/docs/v3/Plugins/ScrollTrigger/?page=1#toggleActions

 

Hopefully this clear things up

Happy Tweening!

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