pattocheu Posted January 24, 2021 Share Posted January 24, 2021 Hello, I desperately try to animate the "Split2" class but only the "split1" class works. After the first "gsap.to" I included a function ( .call(createSplitText()) to animate the "h2" tags but in the timeline only the h2 of "split1" is functional, and I don't see my error. Thanks for your help. ps: Thank you for the nice SplitText: Random Words find on CodePen. See the Pen poEmXab?editors=1111 by pattocheu (@pattocheu) on CodePen Link to comment Share on other sites More sharing options...
PointC Posted January 24, 2021 Share Posted January 24, 2021 I'm not quite sure about the end result here, but if I understand your question correctly, you need to make a slight adjustment. When you call your createSplitText() function you'd want to add the parameter of your target class .call(createSplitText, [split]) Then you can make this change at the beginning of that function. /*-- SplitText function --*/ function createSplitText(target) { let mySplitText = new SplitText(target, { type: "words" }), I think that should work for you. Happy tweening. 3 Link to comment Share on other sites More sharing options...
pattocheu Posted January 24, 2021 Author Share Posted January 24, 2021 hello @PointC many thanks for your help. The effect expected is reached. 🙏 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