Jump to content
GreenSock

Search In
  • More options...
Find results that contain...
Find results in...
Narendra Verma

How to animate the heading and paragraph without affecting on other section

Recommended Posts

Hello,

I am learning scrolltrigger, I am trying to animate the heading and paragraph but it's not animating, sometimes when reload the page then it's already showing the  inline css.

 

This is the basic example I am trying to learn. I check this video  https://greensock.com/docs/v3/Plugins/ScrollTrigger .

 

 

Would you help me out how to animate the heading and paragraph without affecting on other section?

 

See the Pen WNGKrVd by Narendra_verma (@Narendra_verma) on CodePen

Link to post
Share on other sites

Hey @Narendra Verma

 

If you want the animation to play for each section individually, you would want to loop over the sections, apply individual triggers and tween on the individual elements you got - instead of generally targetting all elements with the class of '.heading' like in your example.

 

The Most Common ScrollTrigger mistakes article has an extra section that shows an example of how to do something like that.

 

You should also avoid putting your ScrollTriggers on the individual tweens of a timeline, but set them on the timeline itself instead

 

 

 

 

Give it a try, share your results, and we'll be glad to help you further with this.

 

Cheers,

Paul

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

×