thisGuh Posted November 2, 2021 Share Posted November 2, 2021 Hi everyone! I spent many hours to solve this problem. I want to move "car" by 300px like string above him but "car" is moving only a bit. Does anyone have an idea? See the Pen NWvwvGP by jakiepl (@jakiepl) on CodePen Link to comment Share on other sites More sharing options...
Cassie Posted November 2, 2021 Share Posted November 2, 2021 Hi @thisGuh, You're in two different 'worlds' here. You're moving the text 300px - but the car is in an SVG, so it's moving 300 SVG units. You could do some maths to get the equivalent of 300px but that's possibly a bit too complex, if you're just trying to move the car a bit more you can just use a higher value! I quite like using xPercent and yPercent in SVG because it's easier to quantify how far something's going to move. They move the element relative to its own width/height - xPercent:100 will move the element right by exactly it's own width. See the Pen eYEeepO?editors=1010 by GreenSock (@GreenSock) on CodePen If this doesn't work and you *need* pixels - let me know. 2 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