/ Published in: jQuery
This is the code to add to a website to listen for the Konami Code (as implemented on jQuery.com"
Expand |
Embed | Plain Text
Copy this code and paste it in your HTML
if ( window.addEventListener ) { var kkeys = [], konami = "38,38,40,40,37,39,37,39,66,65"; window.addEventListener("keydown", function(e){ kkeys.push( e.keyCode ); if ( kkeys.toString().indexOf( konami ) >= 0 ) // User entered Konami Code, do something cool!!! }, true); }