var $btnMove = $(".btn_movebox"), $tweenBox = $(".box1"); var myBox = new TimelineLite() $btnMove.on('click',function(e){ e.preventDefault(); myBox.to($tweenBox, 1, {backgroundColor:"#52e252"}) .to($tweenBox, 1, {left:300}) .to($tweenBox, 2, {left:270, width:90, height:90}) })
<a href="#" class="btn btn_movebox">Move!Move!</a> <h4>TimelineLite</h4> <div class="box box1"></div>
.btn{display:inline-block;background-color:#e1e1e1;border:1px solid #000;margin-right:5px;} .box{position:relative;top:0;left:0;width:30px;height:30px} .box1{background-color:#5e54ed}