mak mak - 4 months ago 13
jQuery Question

GSAP Animation of SVG <symbol> does not update <use>

Why, for example animating the

fill
attribute of an element inside a
<symbol>
using TweenMax, has no effect but manipulating it once using jQuery's
attr()
function has?

Example Codepen.

Answer

AttrPlugin of GSAP is the one that should be used here:

TweenMax.fromTo('symbol > rect', 1, {attr: {fill: 'blue'}}, {attr: {fill: 'red'}});

Example.

Further reading:

Comments