Created
September 12, 2014 01:13
-
-
Save webOS101/0cd8698f23aac9ee0327 to your computer and use it in GitHub Desktop.
Animator Sample
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
enyo.ready(function() { | |
enyo.kind({ | |
name: 'Expando', | |
components: [ | |
{ name: 'expander', content: 'Presto', | |
style: | |
'width: 100px; background-color: lightblue; text-align: center;' }, | |
{ name: 'animator', kind: 'Animator', duration: 1500, startValue: 100, | |
endValue: 300, onStep: 'expand', onEnd: 'done' }, | |
{ kind: 'Button', content: 'Start', ontap: 'startAnimator' }, | |
], | |
startAnimator: function() { | |
this.set('$.expander.content', 'Presto'); | |
this.$.animator.play(); | |
}, | |
expand: function(sender, event) { | |
this.$.expander.applyStyle('width', Math.floor(sender.value) + 'px'); | |
}, | |
done: function() { | |
this.set('$.expander.content', 'Change-o'); | |
} | |
}); | |
new enyo.Application({name:'app', view: 'Expando'}); | |
}); |
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
name: Animator Sample | |
description: An example of using the Animator component | |
authors: | |
- Roy Sutton | |
normalize_css: no |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment