Konami Code example
How do I make an konami code example?
Based on what I found at http://www.gethifi.com/blog/konami-code-jquery-plugin-pointlessly-easy, I took the tips of the comments, ran it through JSLint to help clean it up a little, and then through in a hidden div to show off the use of the code instead of triggering an alert.. What is a konami code example? How do you make a konami code example? This script and codes were developed by JR Jenkins on 04 October 2022, Tuesday.
Konami Code example - Script Codes HTML Codes
<!DOCTYPE html>
<html >
<head> <meta charset="UTF-8"> <title>Konami Code example</title> <link rel='stylesheet prefetch' href='http://ajax.googleapis.com/ajax/libs/jqueryui/1.11.2/themes/smoothness/jquery-ui.css'> <link rel="stylesheet" href="css/style.css">
</head>
<body> <html> <head><title>Nothing to see here</title></head> <body> <h1>Move along sir...</h1> <p>There is probably nothing to see here.</p> <div id="thegoodstuff"> <p>Oh, you know Konami? I guess your cool then. Enjoy a random picture from <a href="http://www.lorempixel.com">www.lorempixel.com</a></p> <img src="//lorempixel.com/400/400/" class="img-responsive" /> </div> </body>
</html> <script src='http://cdnjs.cloudflare.com/ajax/libs/jquery/2.1.3/jquery.min.js'></script>
<script src='http://ajax.googleapis.com/ajax/libs/jqueryui/1.11.2/jquery-ui.min.js'></script> <script src="js/index.js"></script>
</body>
</html>
Konami Code example - Script Codes CSS Codes
#thegoodstuff { display: none; }
.img-responsive { display: inline-block; height: auto; max-width: 100%;
}
Konami Code example - Script Codes JS Codes
(function ($) { "use strict"; $.fn.konami = function (callback, code) { if (code === undefined) { code = "38,38,40,40,37,39,37,39,66,65"; } return this.each(function () { var kkeys = []; $(this).keydown(function (e) { kkeys.push(e.keyCode); while (kkeys.length > code.split(',').length) { kkeys.shift(); } if (kkeys.toString().indexOf(code) >= 0) { kkeys = []; callback(e); } }); }); };
}(jQuery));
$(window).konami(function () { "use strict"; $("#thegoodstuff").slideToggle("slow");
});
Developer | JR Jenkins |
Username | jrjenk |
Uploaded | October 04, 2022 |
Rating | 3 |
Size | 2,322 Kb |
Views | 18,216 |
Find the perfect freelance services for your business! Fiverr's mission is to change how the world works together. Fiverr connects businesses with freelancers offering digital services in 500+ categories. Find Developer!
Name | Size |
Style Comments | 3,229 Kb |
Simple jQuery Accordion Example | 3,104 Kb |
Working around OS X Dynamic Scrollbars | 2,279 Kb |
COA Color Swatches | 4,665 Kb |
Reminder about Geolocation | 1,875 Kb |
CSS Slide Show | 2,856 Kb |
BARcade Project Demo | 254,852 Kb |
A Pen by JR Jenkins | 2,697 Kb |
UAC Decode Online | 2,411 Kb |
Jasper is the AI Content Generator that helps you and your team break through creative blocks to create amazing, original content 10X faster. Discover all the ways the Jasper AI Content Platform can help streamline your creative workflows. Start For Free!
Name | Username | Size |
A Pen by Andrea Verlicchi | Verlok | 2,018 Kb |
Brent Burns Tribute Page | Nevada48 | 2,569 Kb |
The CodePen Logo | Kindofone | 4,259 Kb |
OnScreenAction | Ozgursagiroglu | 2,647 Kb |
Flexbox Test | Icutpeople | 2,486 Kb |
GrcJS | Vino6 | 2,047 Kb |
Content Changer | Cliffpyles | 4,538 Kb |
Sony Xperia Z3 Flat MockUp | Dapinitial | 4,379 Kb |
Webkit decolorize | Fivera | 1,675 Kb |
Michelle, submit your photography to Unsplash. | Zaneriley | 3,368 Kb |
Surf anonymously, prevent hackers from acquiring your IP address, send anonymous email, and encrypt your Internet connection. High speed, ultra secure, and easy to use. Instant setup. Hide Your IP Now!