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.39k stars 196 forks source link

Trying to animate top/left without modifying the offset moves the offset to zero #152

Closed leup closed 2 years ago

leup commented 10 years ago

Look at: http://jsfiddle.net/uFsV7/

First move is ok. Second move is not. The top property is reset to zero

Problem seems to with this: https://github.com/benbarnett/jQuery-Animate-Enhanced/blob/master/scripts/src/jquery.animate-enhanced.js#L438

When the property is equal to the new value, the translation offset is equal to zero. and then, problem begins as the translation offset becomes the value. In the end, the property equals zero (translation = 0 - property value => proprerty = property - property = 0).

Well, I'm not sure of my explanation, but I'm sure of the result.

It seems to me that this code piece has been added in:

https://github.com/benbarnett/jQuery-Animate-Enhanced/commit/724d3de728be52b4ae219572ce39887fa721c204#diff-c5d16b22fce6d2f734ffa32b7d35384bR110

and then there is this commit, after:

https://github.com/benbarnett/jQuery-Animate-Enhanced/commit/025da5732cc5435e27f804fb0aff9f540a8c1d1e

that should have revert the first one, but I may be wrong.

Aurelain commented 10 years ago

+1

wow-apps commented 10 years ago

same problem

Snesi commented 10 years ago

Me too.

nicobot commented 9 years ago

+1

leup commented 2 years ago

Closed by #166