Created
April 2, 2013 10:42
-
-
Save jrivero/5291369 to your computer and use it in GitHub Desktop.
Konami code with jquery
This file contains hidden or 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
$(document).ready(function(){ | |
var keys = []; | |
var konami = '38,38,40,40,37,39,37,39,66,65'; | |
$(document) | |
.keydown( | |
function(e) { | |
keys.push( e.keyCode ); | |
if ( keys.toString().indexOf( konami ) >= 0 ){ | |
console.log("konami code") | |
keys = []; | |
} | |
} | |
); | |
}); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment