deffered then問題
? ? scrollTo(5000,1);
? ? ? ? ? ? ? ?}).then(function(){ ? ? ? ? ? ? ? ?
? ? ? ? ? ? ? ? ? // 第二次走路
? ? ? ? ? ? ? ? ? ? return boy.walkTo(5000, 0.5);
? ? ? ? ? ? ? ?});
第二次走路這塊什么時候執(zhí)行呢,then不是很理解,第一個then可以理解是walkTo方法返回deffered對象 then第一個是成功,第二個是啥
2015-08-20
在第一then完成之后,才會直接第二個then
這里要注意?return boy.walkTo(5000, 0.5); ?這個是返回一個新的defferred對象, ?
這個理解有點困難,可以去仔細看看API