Share Posted March 22, 2019 Hi, I need to use a variable for background position. TweenMax.set(item, {backgroundPosition: "center myVariable"}); How can I use myVariable for this? Thanks! Link to comment Share on other sites More sharing options...
Share Posted March 22, 2019 Hello @DevSaver and welcome to the GreenSock Forum! The plus sign (+) concatenates (joins) the string and the variable. var myVariable = "left"; TweenMax.set(item, {backgroundPosition: "center " + myVariable}); Happy Tweening! 5 Link to comment Share on other sites More sharing options...
Author Share Posted March 22, 2019 Thanks! 1 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