Guest Posted August 29, 2021 Share Posted August 29, 2021 I created an animation and I am trying to make make it run using an observer but it does not work and I don't know why. Can you please tell me what I am doing wrong? I added the text to simulate the content on my project See the Pen powjqyg by raul-rogojan (@raul-rogojan) on CodePen Link to comment Share on other sites More sharing options...
Solution nico fonseca Posted August 29, 2021 Solution Share Posted August 29, 2021 Hey @CodyHill, first you need to declare your timelines outside the observer, otherwise every time it is activated you will have a new timeline and then you set pause as default property in the first timeline, so all the timeline tweens are paused. See the Pen 443a63d77367c077e1e674c7d3726834 by nicofonseca (@nicofonseca) on CodePen 3 Link to comment Share on other sites More sharing options...
PointC Posted August 29, 2021 Share Posted August 29, 2021 Hi @CodyHill Welcome to the forum. I'd also point out that GreenSock's ScrollTrigger plugin makes this type of animation much easier. https://greensock.com/docs/v3/Plugins/ScrollTrigger Here's your demo with a quick conversion to ScrollTrigger. See the Pen 5403206d8e9e3b3b87e18a9eafe1810e by PointC (@PointC) on CodePen Hopefully that helps. Happy tweening and welcome aboard. 1 Link to comment Share on other sites More sharing options...
Guest Posted August 29, 2021 Share Posted August 29, 2021 Thank you! But it seems like the skeleton animation does not work. tl.from("#skeleton", { y: "20%", duration: 1 }) EDITE: My bad, it works! but starts on refresh not when the intersection is true Link to comment Share on other sites More sharing options...
Guest Posted August 29, 2021 Share Posted August 29, 2021 Hi @PointC This is awesome! 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