Jump to content
GreenSock

pvalentim

Rotation in Firefox

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,

 

The firefox fix in the current code that addresses a bug in transform could be improved.

It changes the top value but if I have an element positioned with bottom it breaks my layout.

One fix could be just checking if bottom is set and change the bottom value instead.

 

Code I'm refering to:

if (_isFirefox) { //Firefox has a bug that causes transformed elements to randomly disappear during (or after) animation unless a repaint is forced. One way to do this is change "top" by 0.05 which is imperceptible, so we alternate back and forth. Another way is to change the display to "none", read the clientTop, and then revert the display but that is much slower. The bug is present in at least Firefox 17 and 18
  top = _getStyle(targ, "top", null, false, "0");
  n = parseFloat(top) || 0;
  sfx = top.substr((n + "").length);
  t._ffFix = !t._ffFix;
  targ.style.top = (t._ffFix ? n + 0.05 : n - 0.05) + ((sfx === "") ? "px" : sfx);
}

 

Thanks

Link to comment
Share on other sites

I see what you mean - thanks for pointing that out. Would you mind testing the preview of 1.9.2 and let us know if that resolves things for you?

 

[removed attachment - scroll down for updated zip]

  • Like 1
Link to comment
Share on other sites

Still has the same problem.

I'm setting top to "inherit" after the animation is complete as a fix for this.

 

Thanks

 

 

Link to comment
Share on other sites

Ah yes, sorry about that - I see what you're saying and I believe this version resolves the issue (see attached). Better?

1.9.2_preview2.zip

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