jQuery Easter Egg

Do you remember those cheats and easter eggs that you used to trigger on your NES and GameBoy games by pressing a certain sequence of buttons? Now you can add them to your pages with this tiny jQuery plugin!

View the Project on GitHub unindented/jquery-easteregg


Try pressing the following sequence of keys:



If you already have jQuery on your site, then it's just a matter of downloading this plugin and loading it into your page. Then just call the easteregg method on any element you want, providing a callback (callback property) and the sequence of keys that will trigger it (sequence property):

<!DOCTYPE html>
    <meta charset="utf-8">
    <title>jQuery Easter Egg</title>
    <script src="jquery.min.js"></script>
    <script src="jquery.easteregg.min.js"></script>
      $(function () {
          sequence : [38, 38, 40, 40, 37, 39, 37, 39, 66, 65]
        , callback : function () {
            alert('Pizza time!');

If no sequence is provided, the Konami Code sequence will be used (BA).




Copyright (c) 2012 Daniel Perez Alvarez (unindented.org). This is free software, and may be redistributed under the terms specified in the LICENSE file.