Jump to content
Search Community

Animations on text don't work in Chrome/Opera

cedricz 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,

 

I try to animate a text like i animate others objects.

 

On Chrome and Opera, animations on text element are ignored.

On Mozilla Firefox, text is animated but not with the transformOrigin correct.

 

On Edge (may be IE too, i don't have to test) it works perfectly  (for once it is him which works lol)

 

i created a simple exemple in codepen to visualize : 

 

 

Someone could help me please?

 

 

Thanks 

 

Regards

See the Pen wKgery?editors=101 by anon (@anon) on CodePen

Link to comment
Share on other sites

Hello cedricz, and Welcome to the GreenSock Forum!

 

This is not a bug in GSAP but is due to an apparent bug in Chrome & Opera (webkit), regarding animating the SVG <text> tag.

 

I even tried regular CSS transforms, CSS animations, and transitions in the style sheet (codepen's CSS panel) and Chrome refused to animate. Even though you can see in the inspector that GSAP is animating the transform matrix on the <text> tag.

 

So to workaround this SVG text webkit bug, you can wrap your <text> tag in a <g> group element, and animate that instead. 

 

Here is an example of animating the SVG <g> tag parent instead of the SVG <text> tag:

 

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

 

Chrome is full of these types of SVG transform bugs. :blink:

 

Another option is to use the GSAP AttrPlugin to animate SVG child elements and or animate the <animateTransform> or <animate> tag.. but again you might have some issues with SVG animations, since SMIL is not supported fully in all browsers yet.

 

Opera is affected by the same bug as well.. since Opera uses the same webkit port Google modified called Blink.

 

I hope this helps! :)

  • Like 4
Link to comment
Share on other sites

These browser bugs are always gonna be around, especially in webkit based browsers! But your best bet is just animate the svg group tag, which is not uncommon. Otherwise you will have to wait until the Chrome Dev team fixes this bug.

 

You can always submit a Chrome bug report and let them know of this issue:

 

http://dev.chromium.org/for-testers/bug-reporting-guidelines

 

Chrome Dev team said they welcome any bug reports!

 

:)

  • Like 1
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...