<script type="text/javascript" src="Qixi.js"></script>其中引用的Qixi.js在哪里有
2015-12-24
fail: function(func) {
if (typeof func === 'function') {
this.failList.push(func);
}
return this;
},
then: function(doneFn, failFn) {
this.done(doneFn).fail(failFn);
return this;
},
if (typeof func === 'function') {
this.failList.push(func);
}
return this;
},
then: function(doneFn, failFn) {
this.done(doneFn).fail(failFn);
return this;
},
2015-12-20
reject: function() {
this.state = 'rejected';
var list = this.failList;
for (var i = 0, len = list.length; i < len; i++) {
list[0].call(this);list.shift();}
},
done: function(func) {
if (typeof func === 'function') {
this.doneList.push(func);
}return this;
},
this.state = 'rejected';
var list = this.failList;
for (var i = 0, len = list.length; i < len; i++) {
list[0].call(this);list.shift();}
},
done: function(func) {
if (typeof func === 'function') {
this.doneList.push(func);
}return this;
},
2015-12-20
Promise.prototype = {
constructor: 'Promise',
resolve: function() {
this.state = 'resolved';
var list = this.doneList;
for (var i = 0, len = list.length; i < len; i++) {
list[0].call(this);
list.shift();
}
},
constructor: 'Promise',
resolve: function() {
this.state = 'resolved';
var list = this.doneList;
for (var i = 0, len = list.length; i < len; i++) {
list[0].call(this);
list.shift();
}
},
2015-12-20
var Promise = function() {
this.doneList = [];
this.failList = [];
this.state = 'pending';
};
this.doneList = [];
this.failList = [];
this.state = 'pending';
};
2015-12-20
var complete = function() {
defer.resolve();
return;
}
doorLeft.transition({
'left': left
}, time);
doorRight.transition({
'left': right
}, time, complete);
return defer;
} 这块这么写不是更简单,第一个不加complete
defer.resolve();
return;
}
doorLeft.transition({
'left': left
}, time);
doorRight.transition({
'left': right
}, time, complete);
return defer;
} 这块这么写不是更简单,第一个不加complete
var complete = function() {
defer.resolve();
return;
}
doorLeft.transition({
'left': left
}, time, complete);
doorRight.transition({
'left': right
}, time, complete);
return defer;
} 这块这么写也可以
defer.resolve();
return;
}
doorLeft.transition({
'left': left
}, time, complete);
doorRight.transition({
'left': right
}, time, complete);
return defer;
} 这块这么写也可以