Skip to content

Instantly share code, notes, and snippets.

@nbar1
Created April 29, 2014 19:37
Show Gist options
  • Save nbar1/ddba9614ce5cc23aa85c to your computer and use it in GitHub Desktop.
Save nbar1/ddba9614ce5cc23aa85c to your computer and use it in GitHub Desktop.
JQuery Konami Code
var kkeys = [], kcode = "38,38,40,40,37,39,37,39,66,65";
$('body').on('keydown', function(e) {
kkeys.push(e.keyCode);
if(kkeys.toString().indexOf(kcode) >= 0) {
$(document).unbind('keydown', arguments.callee);
$("body").addClass('konami');
}
});
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment