Bug Tracker

Opened 7 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:

Description

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 7 years ago by gnarf

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

comment:2 Changed 7 years ago by Rick Waldron

Component: unfiledeffects

comment:3 Changed 7 years ago by danheberden

Owner: set to danheberden
Status: newassigned

comment:4 Changed 7 years ago by danheberden

Milestone: 1.next1.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:

http://jsfiddle.net/danheberden/4upzp/

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: fixed
Status: assignedclosed

comment:9 Changed 6 years ago by john

Priority: undecidedhigh
Note: See TracTickets for help on using tickets.