/* Add multiple tweens at the same time
In the code below, the second tween is added at a label named "red". Since "red" doesn't yet exist, it is placed at the end of the timeline marking the insertion point for the 2nd tween.
The third tween is also added at the "red" label.
If you want the 2nd and 3rd tween to both start exactly 1 second after the first tween ends, change the second tween to
.to($(".box"), 1, {css:{left:200}}, 1, "red")
read more about the to() method here: http://api.greensock.com/js/com/greensock/TimelineLite.html#to()
*/
var tl = new TimelineLite();
tl.to($("p"), 1, {css:{backgroundColor:"black", color:"white"}})
.to($(".box"), 1, {css:{left:200}}, "red")
.to($("img"), 1, {css:{rotation:360}}, "red")
//the next code block does the same thing but with more code
/*
tl.append(TweenLite.to($("p"), 1, {css:{backgroundColor:"black", color:"white"}}))
.append(TweenLite.to($(".box"), 1, {css:{left:200}}), "red")
.append(TweenLite.to($("img"), 1, {css:{rotation:360}}), "red")
*/
Please Whitelist JSFiddle in your content blocker.
Help keep JSFiddle free for always by one of two ways:
Whitelist JSFiddle in your content blocker (two clicks)
Go PRO and get access to additional PRO features →
Join the 4+ million users, and keep the JSFiddle dream alive.
Ad-free
All ads in the editor and listing pages are turned completely off.
Use pre-released features
You get to try and use features (like the Palette Color Generator) months before everyone else.
Fiddle collections
Sort and categorize your Fiddles into multiple collections.
Private collections and fiddles
You can make as many Private Fiddles, and Private Collections as you wish!
Console
Debug your Fiddle with a minimal built-in JavaScript console.