weddje Posted February 3, 2021 Share Posted February 3, 2021 Hi, I'm trying to animate different elements individually with scrolltrigger (h1, h2, h3, p etc) when entering the viewport. So when h3 comes into the viewport it animates, then paragraph text comes into the viewport and animates etc. I'm on the right track, but I think this can be done in a simpler way. Can anyone advice? See the Pen gOLpGbZ?editors=1010 by weddje (@weddje) on CodePen Link to comment Share on other sites More sharing options...
akapowl Posted February 3, 2021 Share Posted February 3, 2021 Hey @weddje Instead of your sections, you could create an array with all the elements you want to be animated and loop over them. This way you'd only have to write out that code once, that you now have multiple times. 1 Link to comment Share on other sites More sharing options...
Recommended Posts
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 accountSign in
Already have an account? Sign in here.
Sign In Now