Jump to content
Search Community

svg inside svg + To() = doesn't work on Chrome

JackIsJack44 test
Moderator Tag

Warning: Please note

This thread was started before GSAP 3 was released. Some information, especially the syntax, may be out of date for GSAP 3. Please see the GSAP 3 migration guide and release notes for more information about how to update the code to GSAP 3's syntax. 

Recommended Posts

Hello @JackIsJack44 and welcome to the GreenSock Forum!

 

That doesn't work in Chrome due to the nesting of SVG element within another SVG element.
 

You have to target your main parent <svg> #main and not its child nested <svg> #test.

 

var t1 = new TimelineMax();
  
t1.to('#main', 2, {x:200,y:200});

 

See the Pen agOrBJ by jonathan (@jonathan) on CodePen

 

Happy Tweening :)

  • Like 3
Link to comment
Share on other sites

Thanks you but I can't move the main svg (Sorry I didn't explain the whole situation...:))

 

1/ I am using a global svg as a main container because it has a viewbox property that enables me to make zoom/focus easily.

2/ and I use as many svg child as elements because I want to be able to know their positions and width/height easily.

 

Is there a better way to do that  ? 

 

See the Pen BgozYz by jackisjack-the-bold (@jackisjack-the-bold) on CodePen

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.
×
×
  • Create New...