Jump to content
Search Community

Translate an SVG g Element doesn't work

SlimMarten 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

Hi, I am trying to translate an group element <g> with greensock, but somehow it is not working. If I don't use the attrPlugin, it's not working in IE 11 and up 

 

this is my svg:

<svg viewbox="0 0 350 350"><mask id="silhouette">
<g filter="url(#sharpen)">
<g filter="url(#blur)">
<rect x="-25" y="-25" width="400" height="400" fill="#000"></rect>
<circle cx="175" cy="175" r="40" fill="#fff"></circle>
<g class="move" widht="350" height="350">
<circle class="" cx="120" cy="115" r="25" fill="#fff"></circle>
</g>
</g>
</g>
</mask></svg>

and this is how I try to move the group with the class "move"


TweenMax.to(target, duration,{
attr:{
transform: "translate(100,0)"
}
});

The transform values actually become applied, but the group is not moving. I tried moving  a group via transform and translate property before and it changes position if I enter a translate value by default.

 

 

What am I missing here?

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...