Created
November 13, 2012 06:09
-
-
Save arisetyo/4064247 to your computer and use it in GitHub Desktop.
A simple animation using the Greensock for JS library
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<!DOCTYPE html> | |
<html> | |
<head> | |
<meta charset="UTF-8"/> | |
<title>Basic Greensock</title> | |
<script src="minified/TweenMax.min.js"></script> | |
<script type="text/javascript"> | |
function init() { | |
var b = document.getElementById('brie'); | |
TweenMax.to(b, 3, {width:100, ease:Elastic.easeOut, onComplete:animDone}); | |
//OTHER EXAMPLES | |
//TweenMax.to(b, 3, {width:"-=200", ease:Elastic.easeOut, onComplete:animDone}); | |
//TweenMax.to(b, 3, {width:"+=200", ease:Elastic.easeOut, onComplete:animDone}); | |
} | |
function animDone() { | |
alert("hi there.."); | |
} | |
</script> | |
</head> | |
<body onload="init()"> | |
<img src="alison_brie.jpeg" id="brie"/> | |
</body> | |
</html> |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment