geedix Posted March 3, 2022 Share Posted March 3, 2022 I have done something like this before with success, but tonight, I can't make my timeline skip ahead. It logs 'true' for me if I set my mac to prefer reduced motion, or do it in dev tools, but it won't "seek" a future time or label. What am I forgetting? thanks See the Pen zYPeBXQ?editors=1111 by geedix (@geedix) on CodePen Link to comment Share on other sites More sharing options...
geedix Posted March 4, 2022 Author Share Posted March 4, 2022 I guess I don't understand "seek" because I just skipped all the prefers-reduced-motion stuff and I still can't get it to seek a label. Link to comment Share on other sites More sharing options...
Solution PointC Posted March 4, 2022 Solution Share Posted March 4, 2022 You'll need to seek that label after the timeline is created. Just move your seek and you'll be good to go. // tl.seek('end'); // nope tl.to("circle", { x: 140, duration: 3 }) .to("circle", { scale: 1.2, fill: "gold", duration: 2 }, "f1") .to("circle", { y: 40, duration: 2 }, "f1") .to("circle", { x: 60, y: 5, scale: 0.4, duration: 2 }) .to("circle", { scale: 1 }, "end"); tl.seek('end'); Happy tweening. 2 Link to comment Share on other sites More sharing options...
geedix Posted March 4, 2022 Author Share Posted March 4, 2022 Thanks. I thought javascript would follow instructions in sequence, meaning the timeline would run each tween and THEN run the seek command at the bottom. And I thought that declaring the timeline as a variable was the same thing as creating it. But I see now that I was mistaken. 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