Share Posted January 14, 2020 Let's say I have this animation: tl.to('.video-react-video', {left: '-=325px', duration: 1, ease: "back.out(2.5)"}, 9); How can I replace left: '-=325px' with left: '-=someVar' I tried creating a variable as const someVar = '325px'; and then use it as tl.to('.video-react-video', {left: '-=someVar', duration: 1, ease: "back.out(2.5)"}, 9); but it doesn't work. What would be the right syntax? Link to comment Share on other sites More sharing options...
Share Posted January 14, 2020 Hi @Gilbert, For a dynamic value you’ll want to do something like Quote left: “-=“+someVar, 3 Link to comment Share on other sites More sharing options...
Author Share Posted January 14, 2020 hi @Shaun Gorneau, Thanks a lot. That works Link to comment Share on other sites More sharing options...
Share Posted January 15, 2020 @Gilbert, happy to help! 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