Jump to content
GreenSock

Search In
  • More options...
Find results that contain...
Find results in...
Robert Wildling

Animate path of SVG symbol?

Recommended Posts

Hi, GSAP magicians,

 

I am having trouble with animating a path of a SVG that is referenced as symbols.
The codepen shows a left side, where the SVG is implemented "regularly" in the DOM flow. There, the intended animation works (the rectangle needs to be hovered).

The same thing should happen on the right side, where the SVG is referencing a symbol instead.

 

Does anybody of you guys know what I am doing wrong?

The console shows that the original SVG is "copied" to a shadow-root - can "shadow DOM" be accessed anyway?

 

Much appreciated!

Thanks! 

See the Pen mQyvrX by rowild (@rowild) on CodePen

Link to comment
Share on other sites

@Carl Thank you for clearing that up for me and for pointing me to that great article! Much appreciated!

Link to comment
Share on other sites

@Robert Wildling,

 

Good article @Carl! Also, a tip, when animating symbols, or sprites, it is vary useful to use CSS Custom Properties, so that you can animate a specific instance of the symbol or sprite, rather than all of them at once.

 

See the Pen YOWoEa by elegantseagulls (@elegantseagulls) on CodePen

 

  • Like 6
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.
×