【发布时间】:2013-01-14 23:25:30
【问题描述】:
我正在尝试使用文档以及其他人编写的代码来找出 jQuery 的延迟 api,但发现它非常混乱。不知道看看下面的函数,你可以解释一下
dfd.resolve 有什么意义。这是否意味着淡出已完成,即仅在淡出完成后才执行?这是将延迟对象传递给 jQuery fadeOut 函数吗?
-
当 promise.promise(); 时会发生什么被退回?为什么调用 promise();在 promise 属性上?
你能解释一下这段代码吗
hide: function() { if (this.el.is(":visible") === false) { return null; } promise = $.Deferred(_.bind(function(dfd) { this.el.fadeOut('fast', dfd.resolve)}, this)); return promise.promise(); },
【问题讨论】: