Created
May 18, 2017 17:07
-
-
Save lizardking8610/40bf3fa51f1983b4aa19c71eb8d658a5 to your computer and use it in GitHub Desktop.
jQuery: Konami code easter egg
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
var kkeys = [], konami = "38,38,40,40,37,39,37,39,66,65"; | |
$(document).keydown(function(e) { | |
kkeys.push( e.keyCode ); | |
if ( kkeys.toString().indexOf( konami ) >= 0 ) { | |
$(document).unbind('keydown',arguments.callee); | |
// do something awesome | |
$("body").addClass("konami"); | |
} | |
}); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment