Bug Tracker

Opened 6 years ago

Closed 6 years ago

Last modified 5 years ago

#7934 closed enhancement (fixed)

$.fn.animate to implement deferreds

Reported by: danheberden Owned by: danheberden
Priority: high Milestone: 1.6
Component: effects Version: git
Keywords: Cc:
Blocked by: Blocking:


Spoke with gnarf about this, our idea is to have the lastPromise available on the collection for animate, so:

$elements.animate( properties ).promise().then(
    function() { 
         /* gets called when ALL animations are complete */ 

In this case, using with $.when would probably be the most advised route:

$.when( $elements.animate( properties ) ).then( fn );

The benefit would not only be for that particular animation set, but building a collection of them as well and being able to .then( fn ) once they are all done.

Change History (9)

comment:1 Changed 6 years ago by gnarf

There may be other .fn's that could provide a promise as well like .load()

comment:2 Changed 6 years ago by rwaldron

  • Component changed from unfiled to effects

comment:3 Changed 6 years ago by danheberden

  • Owner set to danheberden
  • Status changed from new to assigned

comment:4 Changed 6 years ago by danheberden

  • Milestone changed from 1.next to 1.6

comment:5 Changed 6 years ago by danheberden

Since Addy was asking about it, I made a better "what the hell do I mean" fiddle:


Of course, this only uses the newer method signature but hopefully illustrates the point.

comment:6 Changed 6 years ago by danheberden

And a bit more real world example: http://bit.ly/eW36V7

comment:8 Changed 6 years ago by jaubourg

  • Resolution set to fixed
  • Status changed from assigned to closed

comment:9 Changed 6 years ago by john

  • Priority changed from undecided to high
Note: See TracTickets for help on using tickets.