Skip to content

Instantly share code, notes, and snippets.

@grantges
Created September 24, 2012 22:47
Show Gist options
  • Select an option

  • Save grantges/3778919 to your computer and use it in GitHub Desktop.

Select an option

Save grantges/3778919 to your computer and use it in GitHub Desktop.
animation test
// 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