Jump to content


Tween to svg object

Recommended Posts

How do I get an svg object to go to the position of another one?

I have been banging my head against a wall. Trying to get pink to follow draggable green. Any help would be great :)

See the Pen dJegee by nosurprisethere (@nosurprisethere) on CodePen

Link to comment
Share on other sites

Okay, I'm still having the same problem.

It appears getBBox doesn't see the transforms that GSAP applies.

If you start dragging the green circle, and don't let go, the pink circle won't follow it.

Link to comment
Share on other sites

Hi @huwllewellyn


You wouldn't be banging on your head on the wall had you looked at the pinned SVG Gotchas! thread. Everything you need to know about getBBox is right here, including a helper function that does exactly what you want. 




Give me a minute, and I'll show you how to use it in your demo.

  • Like 4
Link to comment
Share on other sites

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 account

Sign in

Already have an account? Sign in here.

Sign In Now
  • Recently Browsing   0 members

    • No registered users viewing this page.