sagexiang Posted September 29, 2022 Share Posted September 29, 2022 How can I encapsulate the ScrollTrigger as a constructor and then call this function on multiple elements? Are there text or video tutorials? Thank you~ Link to comment Share on other sites More sharing options...
GreenSock Posted September 29, 2022 Share Posted September 29, 2022 ScrollTrigger is already encapsulated and has its own constructor, so I'm a bit confused by your question. Can you provide a minimal demo that shows what you want to do? Link to comment Share on other sites More sharing options...
sagexiang Posted September 29, 2022 Author Share Posted September 29, 2022 Oh, Thank you~So great~I think I need to learn more~ Link to comment Share on other sites More sharing options...
sagexiang Posted September 30, 2022 Author Share Posted September 30, 2022 How can I simplify the code if the same animation is used in multiple places on a web page? Thank you~ Link to comment Share on other sites More sharing options...
Solution GreenSock Posted September 30, 2022 Solution Share Posted September 30, 2022 Can you please provide a minimal demo (like a CodePen) that shows the animation of several simple colored <div> elements that you're wanting to simplify? It's difficult to understand what you're asking when we don't have anything to look at. Once we see some code, I'm sure we can offer some suggestions. You might want to look into gsap.registerEffect() Link to comment Share on other sites More sharing options...
sagexiang Posted October 12, 2022 Author Share Posted October 12, 2022 GreenSock 于 2022 年 9 月 30 日下午 12:03 说道: 您能否提供一个最小的演示(如 CodePen),显示您想要简化的几个简单彩色 <div> 元素的动画?当我们没有任何东西可看时,很难理解你在问什么。一旦我们看到一些代码,我相信我们可以提供一些建议。 您可能想查看gsap.registerEffect() Thank you~ 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