public
Last active

JS: Konami Code

  • Download Gist
jq.konami.js
JavaScript
1 2 3 4 5 6 7 8 9 10 11 12 13
// Konami code with jQuery.
// Source: http://paulirish.com/2009/cornify-easter-egg-with-jquery/
 
var kkeys = [],
konami = "38,38,40,40,37,39,37,39,66,65";
 
$(document).keydown(function(evt) {
kkeys.push( evt.keyCode );
if ( kkeys.toString().indexOf( konami ) >= 0 ){
$(document).unbind('keydown',arguments.callee);
// your easter egg here
}
});

Please sign in to comment on this gist.

Something went wrong with that request. Please try again.