Bug Tracker

Opened 12 years ago

Closed 12 years ago

#9846 closed bug (worksforme)

.done() does not fire when animation has complete callback

Reported by: KarlG Owned by:
Priority: low Milestone: 1.next
Component: deferred Version: 1.6.2
Keywords: Cc:
Blocked by: Blocking:


I'm not completely sure this is a bug, but it does seem to be an unexpected change in behavior from 1.6.1 to 1.6.2. Here is the test case:

<!DOCTYPE html>

    <script type="text/javascript" src="/js/jquery-1.6.2.js"></script>

    <script type="text/javascript">
    $(document).ready(function() {
      var slideUpAndRemove = function() {
        $(this).slideUp(function() { 
      var box = $("#box"); 
        opacity : 0.0
      }, {
        duration : 2000,
        complete : slideUpAndRemove
      $.when(box).done(function() {

    <div id="box" style="color:white;background-color:green;position:absolute;height:200px;width:200px">This is a test box</div>
    <div>Below the animated box</div>

In 1.6.1, the 'done!' alert box consistently appears. It does not in 1.6.2.

I have tested in FF 5 and Chrome 14 (Ubuntu 10.04).

Change History (4)

comment:1 Changed 12 years ago by anonymous

Here's the test case in jsFiddle:


Toggle between loading the two versions to see the bug occur/not occur.

comment:2 Changed 12 years ago by anonymous

The issue seems to be related to the fact that the elements are getting removed in the complete callback. This version accomplishes the same thing and works in 1.6.2:


So, like I said, I'm not sure if this counts as a bug but it is a change in behavior. I can live with the second alternative just fine.

comment:3 Changed 12 years ago by anonymous

Sorry, I seem to have faddled that last fiddle. Here's the alternative I meant to post:


comment:4 Changed 12 years ago by Rick Waldron

Component: unfileddeferred
Priority: undecidedlow
Resolution: worksforme
Status: newclosed

Closing per OPs test case

Note: See TracTickets for help on using tickets.