一.之前的
for (x = 0; x < 6; ++x) {
setInterval((function(x){
return function() {
$(boxItems[x]).fadeOut(3000,function() {
itemPeopleInfoRender(people_infos, $(this));
}).fadeIn(3000);
};
})(x),time_random[x]);
二、之后的
for (x = 0; x < num; ++x) {
(function(x){
var interval = setInterval(function(){
if(!$.contains( document.body,boxItems[x])){
clearInterval(interval);
return;
}
if(animCount>=animMax){
return;
}
animCount++;
$(boxItems[x]).fadeOut(bigBubbleDur,function() {
itemPeopleInfoRender(people_infos, $(this));
}).fadeIn(bigBubbleDur,function(){
animCount--;
});
},time_random[x]);
})(x);
}