老师给个答案,想不通????
if(dir === "left"){
this.posterItems .each(function(){
var self = $(this),
prev = self.prev().get(0)?self.prev():_this_.posterLastItem,
width = prev.width(),
height =prev.height(),
zIndex = prev.css("zIndex"),
opacity = prev.css("opacity"),
left = prev.css("left"),
top = prev.css("top");
zIndexArr.push(zIndex);
self.animate({
width:width,
height:height,
//zIndex:zIndex,
opacity:opacity,
left:left,
top:top
},_this_.setting.speed,function(){
_this_.rotateFlag = true;
});
});
中的self是肯定是其中一个的对象的prve值,那each里的self.animate改变当前self的值后,那后面的each再取它的prev,却正好是改变的那个self,可这个prev的值已经改变,不是就不准了吗????