我有这个在图像之间滑动的 JS,但我想将它们更改为淡出 - 更改这些的最佳方法是什么?
这是一个完整的演示,因为它更好:http: //jsfiddle.net/mJcTA/6/
animate: function () {
var nextItem, pos;
// check whether there are enough items to animate to
if (this.itemIndex > (this.noOfItems - this.options.itemsPerPage)) {
this.itemIndex = this.noOfItems - this.options.itemsPerPage; // go to last panel - items per transition
}
if (this.itemIndex < 0) {
this.itemIndex = 0; // go to first
}
nextItem = this.items.eq(this.itemIndex);
pos = nextItem.position();
if (headache) {
this.runner
.stop()
.animate({ left: -pos.left }, this.options.speed, this.options.easing);
}
else {
this.mask
.stop()
.animate({ scrollLeft: pos.left }, this.options.speed, this.options.easing);
}
this.updateBtnStyles();
}