See it in action here: kevinberonilla.com/demos/jquery-cheat-code
jQuery 1.2.6 or higher
Download the plugin via Bower or manually copy the JS files to your site, then include them in the <head>
tag.
bower install jquery-cheat-code
<head>
<script src="https://ajax.googleapis.com/ajax/libs/jquery/1.11.3/jquery.min.js"></script>
<script src="js/jquery-cheat-code.min.js"></script>
</head>
$(document).ready(function() {
$(document).cheatCode();
});
$(document).ready(function() {
$(document).cheatCode({ // Default values below
code: 38384040373937396665,
time: 500,
callback: function() { alert('Invincibility enabled!'); }
});
});
code
Number or string containing a combined set of key codes without spaces that represents your cheat code (default value is the Konami code sans Start button)
time
Number representing the amount of time in milliseconds allowed between sequential key presses before the input is reset
callback
Function that fires when the cheat code is successfully executed
Included with the plugin is a generator you can use to determine your code string.