Skip to content

Instantly share code, notes, and snippets.

@elango
Forked from rblalock/Animations.js
Created November 10, 2010 11:06
Show Gist options
  • Save elango/670701 to your computer and use it in GitHub Desktop.
Save elango/670701 to your computer and use it in GitHub Desktop.

Revisions

  1. @rblalock rblalock created this gist Nov 9, 2010.
    26 changes: 26 additions & 0 deletions Animations.js
    Original file line number Diff line number Diff line change
    @@ -0,0 +1,26 @@
    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 });
    });
    });
    });