var lunbo2 = { dom:null, count:0, index:0, interval:null, start:function(fun){ var i = this.index; var dom = this.dom; this.interval = setInterval(()=>{ i ++; if(i == this.count){ i = 0; } //mui("#aa li") dom.each(function(k, v) { if(k == i){ v.classList.add("active"); }else{ v.classList.remove("active"); } }); let top = i * 60+10; TweenLite.to("#block2", 0, { top: top, onComplete: (param) => { fun(i); //mui('#slider2').slider().gotoItem(parseInt(i)); }, onCompleteParams: [] }); },3000); }, stop:function(){ clearInterval(this.interval); } }