Using jQuery this is the smallest I can get an implementation of the Konami Code in javascript. This example uses it to make the page CAPSLOCK MODE.

function konami(){$("body").css("text-transform","uppercase")}
$(document).ready(function(){window.kc=0;$(document).keydown(function(e){window.kc=e.which==(new Array(38,38,40,40,37,39,37,39,66,65,13))[window.kc]?window.kc+1:0;if(window.kc>10){konami()}})})

Responses


Mentions

Leave a Reply

Your email address will not be published. Required fields are marked *