Created
May 4, 2015 19:02
-
-
Save vwasteels/c88a9b8cb7a09209469f to your computer and use it in GitHub Desktop.
Class example for Xavinouchou
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
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