var myTween = new TweenMax.to('.box1', 2, {width:100,height:100,repeat:1,yoyo:true,paused:true}), myTween2 = new TweenMax.to('.box2', 2, {width:100,height:100,repeat:-1,yoyo:true,paused:true}); $('.btn1').on('click',function(){ myTween.resume(); }) $('.btn2').on('click',function(){ myTween2.resume(); })
<button type="button" class="btn1">repeat 1</button> <br><br> <div class="box box1"></div> <hr> <button type="button" class="btn2">repeat infinite</button> <br><br> <div class="box box2"></div>
.box{width:50px;height:50px;background-color:#000}