Jump to content
Search Community

GSAP - My Tweens in my ScrollTrigger Timeline are applying to other elements

lukestoked test
Moderator Tag

Go to solution Solved by mvaneijgen,

Recommended Posts

Hi everyone,

 

I need my GSAP timeline to be working correctly over multiple elements with the same class as I will be pulling in multiple articles using a looper with two images on that need to change on scroll.

 

Is there any way to make it so that my ScrollTrigger and Tweens will only effect the children on the main div and not any other elements on the page with the same class, as you can see on my codepen it triggers the animation on the second section prematurely.

 

Not sure if this is a scoping issue or I need to use a selector of some sort to only target the classes in the element that's currently active.

 

Could I potentially add a class while the timeline is active?

See the Pen poqVJLx by luke-stoked (@luke-stoked) 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...