benbarnett / jquery-animate-enhanced

Extend $.animate() to detect CSS transitions for Webkit, Mozilla, IE>=10 and Opera and convert animations automatically.
http://playground.benbarnett.net/jquery-animate-enhanced/
MIT License
1.38k stars 197 forks source link

Transitions do not use3DByDefault when it is available. #110

Closed geek-caroline closed 11 years ago

geek-caroline commented 11 years ago

There is a property:

    use3DByDefault

and this is set to be true which is what I want (this issue stems from me finding only this translate3d is optimised on the iPad).

However, if one does not specify at the time of calling a transition that one wants to use 3D, it seems to me that it will never be used.

At line 344 the implementation of getTranslation:

    return ((use3D === true || (use3DByDefault === true && use3D !== false)) && has3D) ? 'translate3d(' + x + 'px, ' + y + 'px, 0)' : 'translate(' + x + 'px,' + y + 'px)';

in essence, due to the calling process it actually means:

as there is a test to see whether useTranslate3d was passed in as a property in the chain of calls leading to this test and if it was not this value is set to false:

_applyCSSTransition(
    ....
    prop.useTranslate3d === true);

meaning that in essence the two queries in getTranslation become redundant as either use3D is explicitly declared or will be false?

benbarnett commented 11 years ago

Thanks for the detailed report