TweenLite


TweenLite.to()
var tween = document.getElementsByClassName('tween1');
TweenLite.to(tween , 2 , {width:100 , height:100 , backgroundColor:"#ff0000" } );

The target can also be an array of objects.
TweenLite.to( ['.tween2','.tween3','.tween4'], 3 , {opacity:0.8 , rotation:360 , x:600 });

TweenLite.from()
TweenLite.from('.twennfrom1',5,{opacity:0 , rotation:360 , x:700});

TweenLite.fromTo()
TweenLite.fromTo('.tweenfromto' , 3 , {width:600 , opacity:0 },{width:100 , opacity:1,paused:true} );

Function-based values refresh page and click
TweenLite.to('.tweenx',3,{x: function(){return Math.random() * 400;}});
TweenLite.to('.tweeny',2,{x:function(index,target) {console.log(index + target);return (index + 1) * 200;

TweenLite Method


.Delay()
var animation1 = TweenLite.to('.tween-delay',2,{x:300 , delay:3});
console.log(animation1.delay()); // get curent delay 3
animation1.delay(0);// set new delay

Delay on TweenLite.from() works

"immediateRender:true" default
var animation2= TweenLite.from('.tween-from-delay-1',2 ,{x:800 , delay:2,immediateRender:true });
"immediateRender:false"
var animation3= TweenLite.from('.tween-from-delay-2',2 ,{x:800 , delay:2, immediateRender:false });

TweenLite.delayedCall()


animation4 = TweenLite.delayedCall(3,myfunctiontocall,["Omar","24"]); //call the function 'myfunctiontocall' after 'delay' 3s

.duration()



You can set duration : duration(number);

.eventCallback()refresh to click again

var animation6 = TweenLite.to('.eventCallback',4,{rotation:360 , x:600});
animation6.eventCallback("onComplete",callbackfunction);

wait until complete animation
The same : TweenLite.to('.eventCallback',2,{rotation:360 , x:600, onComplete:callbackfunction});

.invalidate()

var animation7 = TweenLite.to('.invalidate',3,{x:"+=100" , rotation:"+=360" });
$('.restart').click(function () { animation7.restart(); });

$('.Invalid').click(function () {
animation7.invalidate();
animation7.restart(); });

.isActive()


.kill()


TweenLite.killDelayedCallsTo()

wait 3s to see text below => refresh to repeat


.pause(),.restart(),.play(),.progress()


.reverse()


.seek()


.resume()


TweenLite.set()

Immediately sets properties of the target accordingly


.startTime()

Not Clear to me yet


.time()

gets current time which will never be less than 0 or greater than the animation's duration
Duration of this animation is 3


.timeScale()

1 = normal speed (the default)
0.5 = half speed,
2 = double speed