Skip to content

Instantly share code, notes, and snippets.

@vwasteels
Created May 4, 2015 19:02
Show Gist options
  • Save vwasteels/c88a9b8cb7a09209469f to your computer and use it in GitHub Desktop.
Save vwasteels/c88a9b8cb7a09209469f to your computer and use it in GitHub Desktop.
Class example for Xavinouchou
var Tile = function(width, height) {
this.width = width;
this.height = height;
this.size = this.width * this.height;
};
Tile.prototype = {
get el() {
return '<div>MyTile</div>';
},
show: function() {
$(this.el).show();
},
hide: function() {
$(this.el).hide();
}
};
var myTile = new Tile(5, 3);
myTile.show();
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment