Jump to content
Search Community

Not able to add scrolltrigger to this stagger animation

JohnnyD test
Moderator Tag

Go to solution Solved by akapowl,

Recommended Posts

  • Solution

Hey Johnny,

 

JavaScript is case sensitive, and it looks like you just have a typo.

You wrote scrolltrigger  in the tween's vars, all lower-case, but in there it is supposed to be written as scrollTrigger in camelCase.

 

That should work better already then.
 

gsap.to(triangles, {
  opacity: 1,
  stagger: {
    amount: 5,
    y: 0
  },
  scrolltrigger: { // <----- change this to scrollTrigger
    trigger: "#triangles-pattern",
    start: "top 80%",
    markers: true
  }
});


 

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