Posted By

JakeCarter on 06/09/09


Tagged

jquery Konami easteregg


Versions (?)

Who likes this?

8 people have marked this snippet as a favorite

hERB
neal_grosskopf
marvin_speakman
LeslieOA
alejandrosuch
jfherring
Foxyfox
clacwebstudio


jQuery Konami Code Listener


 / Published in: jQuery
 

This is the code to add to a website to listen for the Konami Code (as implemented on jQuery.com"

  1. if ( window.addEventListener ) {
  2. var kkeys = [], konami = "38,38,40,40,37,39,37,39,66,65";
  3. window.addEventListener("keydown", function(e){
  4. kkeys.push( e.keyCode );
  5. if ( kkeys.toString().indexOf( konami ) >= 0 )
  6. // User entered Konami Code, do something cool!!!
  7. }, true);
  8. }

Report this snippet  

You need to login to post a comment.