Skip to content

Instantly share code, notes, and snippets.

@Shinpeim
Created April 7, 2015 14:27
Show Gist options
  • Save Shinpeim/85a7af15be09a3e769d7 to your computer and use it in GitHub Desktop.
Save Shinpeim/85a7af15be09a3e769d7 to your computer and use it in GitHub Desktop.
// まずこうすれば関数はひとつにまとめられて
function renderNotes(key, cssId){//key1notesの中の状態を探って、それを#key1の鍵盤に反映させる関数
if(key.notes!=null){
for(var i=0;i<key1.notes.length;i++){
var kari= cssId + " ." + key.notes[i];
$(kari).addClass("osu");
}//for文
} else{
key.notes=[];
}
}
renderNote(key1, "#key1");
renderNote(key2, "#key2");
renderNote(key3, "#key3");
renderNote(key4, "#key4");
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment