Danraffe Posted November 8, 2021 Share Posted November 8, 2021 Hello, I am new to GSAP and am wondering if it is possible to translate an object as a function of the tweens duration? For example, if I wanted an image to "jump" in a single tween, could I call something like gsap.to(".img", {y: () => {Math.sin(current duration * Math.PI)}, duration:1} If so, how might I do that? Link to comment Share on other sites More sharing options...
Solution GreenSock Posted November 8, 2021 Solution Share Posted November 8, 2021 Welcome to the forums, @Danraffe. I'm not sure I understand your question properly, but maybe you mean something like this?: See the Pen af0a85de0f932b4685a7a5b30b3153a4 by GreenSock (@GreenSock) on CodePen 1 Link to comment Share on other sites More sharing options...
Danraffe Posted November 8, 2021 Author Share Posted November 8, 2021 Yes! Just what I was looking for, 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