Created
November 9, 2010 16:46
-
-
Save rblalock/669357 to your computer and use it in GitHub Desktop.
Example animation methods
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
Ti.include( 'includes/tiframework.js' ); | |
var $ = TiFramework; | |
var main_window = $('currentWin'); | |
main_window.focus(function() { | |
// Create the label | |
var label = $('label') | |
// Set some options | |
.setOpts({text: 'New Label', color: '#999', height: 50, top: 10}) | |
// Slide in the label | |
.slideIn() | |
// Append it to the window | |
.appendTo(main_window) | |
// Add a click event listener | |
.click(function() { | |
// Slide the label out. When finished create a new window and load in | |
// new file and navigate | |
label.slideOut({duration: 1000}, function(){ | |
var newWindow = $('window').setOpts({title: 'Test', url: 'animations.js'}); | |
Ti.UI.currentTab.open(newWindow.context, { animated:true }); | |
}); | |
}); | |
}); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment