jQuery 1.6開始animation也支援Deferred操作了!

$.when($('#timeline').animate({ left: 100 }),  $.ajax({
    url: 'fake.json', dataType: 'json'
})).done(function(){
    $('#result').text('done!');
});

測試用的jsfiddle:

{% jsfiddle wLHaG %}

Comments

comments powered by Disqus