Created
September 24, 2012 22:47
-
-
Save grantges/3778919 to your computer and use it in GitHub Desktop.
animation test
This file contains hidden or 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
| // this sets the background color of the master UIView (when there are no windows/tab groups on it) | |
| Titanium.UI.setBackgroundColor('#fff'); | |
| var win = Ti.UI.createWindow(); | |
| var webView = Ti.UI.createWebView({ | |
| url: 'http://www.google.com', | |
| height: 400, | |
| top: 0, | |
| width: Ti.API.FILL | |
| }); | |
| win.add(webView); | |
| var button = Ti.UI.createButton({ | |
| title: "animate", | |
| width: 150, | |
| height: 40, | |
| bottom: 10 | |
| }); | |
| button.addEventListener('click', function(e){ | |
| var _matrix = Ti.UI.create2DMatrix().rotate(-180).scale(3); | |
| webView.animate({ | |
| transform : _matrix, | |
| duration : 1500, | |
| anchorPoint : { | |
| x : 0, | |
| y : 1 | |
| }, | |
| opacity: 0.0 | |
| }, function() { | |
| alert('Done'); | |
| }); | |
| }); | |
| win.add(button); | |
| win.open(); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment