user453089
user453089

Reputation: 739

jQuery: do after complete animate doesn't work

$comment.animate({width: 0}, {queue:false, duration:450 }, function() { 
//$comment.css({ 'display': 'block' })
$comment.hide();
 });

it doesn't show animation. i guess that i have put a function is wrong place.

Upvotes: 4

Views: 4227

Answers (1)

T.J. Crowder
T.J. Crowder

Reputation: 1075755

Per the docs, if you specify options, include the callback in the options rather than separately:

$comment.animate({width: 0}, {
    queue:    false,
    duration: 450,
    complete: function() { 
        //$comment.css({ 'display': 'block' })
        $comment.hide();
    }
});

Upvotes: 11

Related Questions