個人感覺,var j = i;那里,可以寫成i++;然后后面直接調用opacity:1/i,left:fixOffsetLeft+i*gap-rw,會更簡潔易懂一點
2016-09-26
zIndex的設置有點太繞了,既然是怕直接設置會產生并發效果,直接用animate的callback就可以解決。
self.animate({
zIndex:zIndex,
},1,function(){
self.animate({
width:width,
height:height,
opacity:opacity,
left:left,
top:top
})
})
self.animate({
zIndex:zIndex,
},1,function(){
self.animate({
width:width,
height:height,
opacity:opacity,
left:left,
top:top
})
})
2016-09-26