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

Deferred format doesn't seem to be possible #98

Open scottopherson opened 12 years ago

scottopherson commented 12 years ago

When using this plugin, handling animation callbacks using the deferred format doesn't seem to be possible:

$('.elements').animate({ left: '100px' });

$.when( $('.elements') ).done(function( elements ) {
  // all elements are done animating
});
// when animate-enhanced is included the callbacks are fired immediately

The callbacks are fired but they are fired immediately, not when the animation is complete so I'm forced to pass a callback directly to .animate() which doesn't allow the benefits of using deferreds. Disabling the plugin resolves the issue, however, that obviously isn't a desirable solution. I've looked through the source code but haven't grokked it well enough yet to create a solution.

klimashkin commented 12 years ago

Faced with the same problem. I am forced to postpone the use of your plugin. Sorry. I'll wait for the version with this fix

benbarnett commented 11 years ago

Yeah this will require some new work on the plugin since promises are relatively new in jQuery. I'll look into this when time allows.

skill83 commented 11 years ago

I faced the problem too. I'll wait also for the next release

justinbach commented 11 years ago

Also would really like to see support for promises in the next version.

atanarro commented 10 years ago

I have added a wrapper plugin to be able to use promises with this library: https://gist.github.com/atanarro/10145573