Skip to content

Instantly share code, notes, and snippets.

@webOS101
Last active October 13, 2015 21:57
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/4261543 to your computer and use it in GitHub Desktop.
Save webOS101/4261543 to your computer and use it in GitHub Desktop.
Dynamic Light
<script>
var light = new Light({color: "green"}).renderInto(document.body);
light.setColor("blue");
</script>
enyo.kind({
name: "Light",
published: {
"color" : "yellow"
},
style: "width: 50px; height: 50px; border-radius: 50%;",
create: function() {
this.inherited(arguments);
this.colorChanged();
},
colorChanged: function(oldValue) {
this.applyStyle("background-color", this.color);
}
});
name: Dynamic Light
description: Example showing how to update color of a Light instance after it's created
authors:
- Roy Sutton
normalize_css: no
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment