animate: function( prop, speed, easing, callback ) { 
var empty = jQuery.isEmptyObject( prop ), 
optall = jQuery.speed( speed, easing, callback ), 
doAnimation = function() { 
// Operate on a copy of prop so per-property easing won't be lost 
var anim = Animation( this, jQuery.extend( {}, prop ), optall ); 
// Empty animations resolve immediately 
if ( empty ) { 
anim.stop( true ); 
} 
}; 
return empty || optall.queue =https://www.jb51.net/article/== false ? 
this.each( doAnimation ) : 
this.queue( optall.queue, doAnimation ); 
}, 
到目前为止,所有异步的东西都被jQuery改造成异步列队的“子类”或叫“变种”更合适些。如domReady, 动画,AJAX,与执行了promise或delay或各种特效方法之后的jQuery对象。于是所有异步的东西在promise的加护下,像同步那样编写异步程序。
您可能感兴趣的文章:
