Created
April 7, 2015 14:32
-
-
Save Shinpeim/51f3df6602a4d083e633 to your computer and use it in GitHub Desktop.
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
// さらにKeyのメソッドにしてやれば、 | |
// KeyのことはKeyにやらせるというオブジェクト指向的な感じになる | |
Key.prototype.renderTo = function(cssId) { | |
if(this.notes!=null){ | |
for(var i=0; i < this.notes.length; i++){ | |
var selector = cssId + " ." + this.notes[i]; | |
$(selector).addClass("osu"); | |
} | |
} else { | |
this.notes=[]; | |
} | |
}; | |
key1.renderTo("#key1"); | |
key2.renderTo("#key1"); | |
key3.renderTo("#key1"); | |
key4.renderTo("#key1"); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment