Jump to content
Search Community

ScrollTrigger: Apply Animation on multiple elements

Sveninyo test
Moderator Tag

Recommended Posts

Hi,

I am wondering, why my transition animation is just played on my first section and not on the following. I added the same class (.parallax) to both my text boxes.

Isn't the animation suppose to play on every (each) element that has the class "parallax" applied to it? See my CodePen.

 

Thank for the help!

 

See the Pen yLeJOzb by Sveninyo (@Sveninyo) on CodePen

Link to comment
Share on other sites

Hey Sveninyo.

 

The issue here is that your tween affects all of your parallax sections so the later ones are already done by the time you reach them. To get the effect that you're wanting you should loop through each section, creating a tween and ScrollTrigger for each.

See the Pen abdZZOM?editors=0010 by GreenSock (@GreenSock) on CodePen

 

Side notes:

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