Jump to content
Search Community

Rotation in Firefox

pvalentim 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



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);



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