$interval(function(){ //定时跳动 for (var i=0;i<posLen;i++){ $('#lot_num>div:eq('+i+') span').removeClass(activeBallClass); if ($.inArray('&',codes[0][0])==-1) { $('#lot_num>div:eq('+i+') .code-value-'+codes[i][j]+ ' span').addClass(activeBallClass); }else { var tmpArr = codes[i][j].split(sepIn); for(var v of tmpArr){ $('#lot_num>div:eq('+i+') .code-value-'+v + ' span').addClass(activeBallClass); } } } j++; },t,len);