Jump to content
Search Community

I can't assign a timeline properties into a loop forEach

JoffreyPersia test
Moderator Tag

Go to solution Solved by akapowl,

Recommended Posts

Hi, 

I am new here, and i am a greensock enthusiast (and a newbie in JS and GSAP ^^)
I discovered this JS library few days ago, watched a Udemy tutorial, and I am trying to implement it on my WordPress Oxygen Builder website. 

 

This is also my first CodePen to show you my problem : inside the loop "forEach" I created a timeline with some properties, but I don't understand why the properties are not active when the scrollTrigger trigger...

Thank you :)

See the Pen MWvpdXb by pixelmort27 (@pixelmort27) on CodePen

Link to comment
Share on other sites

  • Solution

Hello @JoffreyPersia and welcome to the forums.

 

If you want to apply a ScrollTrigger to a timeline, the scrollTrigger object needs to be on the timeline itself and not on seperate tweens of the timeline.

 

That is one of the most common ScrollTrigger mistakes as mentioned in this article - which will be really handy for avoiding other mistakes as well :) 

 

 

 

 

Does this work more like what you intended?

 

See the Pen 45efd568a09fb9e429290d80dcfbe42d by akapowl (@akapowl) on CodePen

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