Skip to content

Instantly share code, notes, and snippets.

@jlittlejohn
Created May 31, 2013 20:41
Show Gist options
  • Save jlittlejohn/5687830 to your computer and use it in GitHub Desktop.
Save jlittlejohn/5687830 to your computer and use it in GitHub Desktop.
JS: Konami Code
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