老師給個答案,想不通????
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的值已經改變,不是就不準了嗎????
2016-10-09
請看這條討論的問題:http://www.xianlaiwan.cn/qadetail/77873