Jump to content
Search Community

RotationY not working in Firefox, IE11 or Edge

Briony test
Moderator Tag

Go to solution Solved by Jonathan,

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 there... I've just started with greensock and been loving it so far. 

 

However, I'm having an issue with getting rotationY to work in Firefox, IE11 and Edge. I need to support these browsers and everything else has worked perfectly!

 

I've attached my codepen, can anyone help? It works perfectly in Chrome and Opera!

See the Pen EyXLKY by Briony (@Briony) on CodePen

Link to comment
Share on other sites

  • Solution

Hello Briony and welcome to the GreenSock Forum!

 

This is more of what is supported in the various modern browsers. The reason why rotationY is not working in Firefox, MS Edge and IE11, is because CSS 3D transforms are not supported for SVG child elements in the SVG 1.1 spec. Since you are trying to rotate on the Y-axis, which will intersect with z-axis on the 3D plane when rotationY is rotated.

 

Firefox and Microsoft honor the SVG 1.1 spec in this regard, not allowing CSS 3D transforms. Webkit based browsers like Safari, Opera, and Chrome will allow certain non-standard illegal behavior for a time and then will remove that non-standard behavior to line up with the spec.

 

So in this case Firefox, IE11, and MS Edge are doing what there supposed to and not allowing CSS 3D transforms on SVG child elements. Firefox, IE11, and MS Edge will allow CSS 3D transforms on the <svg> element, but not their children elements so they adhere to standard SVG 1.1 behavior .

 

You can fake that rotationY effect you were going for on SVG child elements with scaleX since it is a CSS 2D transform property.

 

And get a similar result cross browser:

 

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

var timelineOne = new TimelineMax({repeat:-1, yoyo:true} );
//fin
timelineOne
.add(TweenMax.fromTo(".fin", 0.1,
    {
      transformOrigin: "50% 50%", 
      scaleX: 1,
      x:-3
    }, {
      transformOrigin: "50% 50%", 
      scaleX: 0.9, 
      x:-3
    }
));

That is why i always first debug and test in Firefox first making sure how standard CSS behavior will render. Since Firefox always follows the various web specs. Whereas safari, chrome, and opera webkit will always have non-standard behavior constantly adding and removing the illegal behavior confusing web developers and web designers.

 

You will have to wait until SVG 2.0 is out, that will support 3D transform on SVG child elements!

 

UPDATE:
You could however use rotateY() (rotationY) on SVG child elements as long as the transform doesnt use matrix3d() or rotate3d().

 

:)

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