jquery-animate-enhanced icon indicating copy to clipboard operation
jquery-animate-enhanced copied to clipboard

Deferred format doesn't seem to be possible

Open scottopherson opened this issue 13 years ago • 5 comments

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.

scottopherson avatar Sep 05 '12 14:09 scottopherson

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

klimashkin avatar Sep 09 '12 11:09 klimashkin

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.

benbarnett avatar Oct 17 '12 15:10 benbarnett

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

skill83 avatar Feb 20 '13 18:02 skill83

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

justinbach avatar May 17 '13 12:05 justinbach

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

atanarro avatar Apr 08 '14 16:04 atanarro