Jump to content
Search Community

scrolltrigger many elements on react

pietdasilva test
Moderator Tag

Go to solution Solved by GreenSock,

Recommended Posts

  • Solution

I assume you wanted to do something like this?:

https://codesandbox.io/s/objective-mcnulty-tj370o?file=/src/App.js

 

The problems:

  1. You set your trigger element to a selector function (not an element, and not the results of the function call). 
  2. You created ONE tween of ALL the circles that would get triggered at one spot, but I think you wanted an animation for EACH of the circles, all with their own ScrollTrigger so they fire and different spots (when they enter). So a .forEach() loop is perfect. 

Does that help?

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