A Funny jQuery Plugin To Enable The Konami Code On Your Website

File Size: 12.4KB
Views Total: 2367
Last Update:
Publish Date:
Official Website: Go to website
License: MIT
   
A Funny jQuery Plugin To Enable The Konami Code On Your Website

Konami Code is a simple and funny jQuery plugin that executes a specified callback function when the visitor types the famous 'Konami Code' or any other custom key sequences. Ideal for create an interesting and funny Easter Egg to your website.

How to use it:

1. Include the latest jQuery javascript library and jQuery konami code plugin on the website.

<script src="http://ajax.googleapis.com/ajax/libs/jquery/1.10.2/jquery.min.js"></script>
<script type="text/javascript" src="jQuery_konami_code.js"></script>

2. Call the plugin with default callback function (console.log() and alert()).

<script type="text/javascript">
$(document).konami_code()			
</script>

3. Custom your own key sequence.

<script type="text/javascript">
$(document).konami_code({
mySequence: '49 50 51 52 53', // 1, 2, 3, 4, 5 
activeCode: 'mySequence'
})          
</script>

Change log:

2014-01-28

  • changing a global variable, executionCount, to private

2014-01-12

  • adjusted to allow for configuration to accept and handle an alternate scope than the global window. Also arguements can be passed to the callback if needed.

2013-11-30

  • security fix

This awesome jQuery plugin is developed by theInternauts. For more Advanced Usages, please check the demo page or visit the official website.