Skip to content

Instantly share code, notes, and snippets.

@webOS101
Created September 12, 2014 01:13
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save webOS101/0cd8698f23aac9ee0327 to your computer and use it in GitHub Desktop.
Save webOS101/0cd8698f23aac9ee0327 to your computer and use it in GitHub Desktop.
Animator Sample
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'});
});
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