rstacruz / jquery.transit

Super-smooth CSS3 transformations and transitions for jQuery
http://ricostacruz.com/jquery.transit
7.3k stars 864 forks source link

Syntax for complete callback. Complete should be in second param. #170

Open hannesjohansson opened 10 years ago

hannesjohansson commented 10 years ago

The 'as "complete"' test is broken in both IE and Chrome as the complete callback is fired before the animation ends. This is fixed by passing complete as a part of the second parameter object.

This is also how jQuery animate does it, as transition() follows its syntax: http://api.jquery.com/animate/

Passing a complete callback inside the first object does not work in $.fn.animate: http://codepen.io/anon/pen/fErzb

hannesjohansson commented 10 years ago

This pull request fixes the bug in the test case: https://github.com/bolster/jquery.transit/commit/05a2de3d29e6ca5843c36449447c9e15bf576ed5

But to be compatible with jquery.animate() you should still pass the complete function in the second parameter

hannesjohansson commented 10 years ago

This is the same issue as #169