Pen Settings



CSS Base

Vendor Prefixing

Add External Stylesheets/Pens

Any URLs added here will be added as <link>s in order, and before the CSS in the editor. You can use the CSS from another Pen by using its URL and the proper URL extension.

+ add another resource


Babel includes JSX processing.

Add External Scripts/Pens

Any URL's added here will be added as <script>s in order, and run before the JavaScript in the editor. You can use the URL of any other Pen and it will include the JavaScript from that Pen.

+ add another resource


Add Packages

Search for and use JavaScript packages from npm here. By selecting a package, an import statement will be added to the top of the JavaScript editor for this package.


Save Automatically?

If active, Pens will autosave every 30 seconds after being saved once.

Auto-Updating Preview

If enabled, the preview panel updates automatically as you code. If disabled, use the "Run" button to update.

Format on Save

If enabled, your code will be formatted when you actively save your Pen. Note: your code becomes un-folded during formatting.

Editor Settings

Code Indentation

Want to change your Syntax Highlighting theme, Fonts and more?

Visit your global Editor Settings.


	<h3>Accessibility jQuery tabindex enter/return key "clickable" fix</h3>
	<p>Often UI elements with tabindex="0" will not respond to hitting the enter key. The easiest way to fix this is to create a simple keypress event that simulates a keypress. This hack doesn't require a fix to existing libraries. Below is jQuery Cycle 2 slide show with a pager that normally does not respond to the return key.</p>
	<div class="cycle-slideshow"  data-cycle-timeout="0" data-cycle-prev="#prev" data-cycle-next="#next" data-cycle-pager-template="<span tabindex='0'>•</span>">
		 <div class="cycle-pager"></div>
			<img src="" alt="Black and white slide of flower in the Columbia Gorge - photo by Greg">
			<img src="" alt="Black and white slide of two friends looking overlooking Lava Canyon - photo by Greg">
			<img src="" alt="Black and white slide Red Rocks outside of Las Vegas - photo by Greg">

	<a href=# id="prev" tabindex="0"><i class="fa fa-chevron-left" aria-hidden="true"></i>
	<a href=# id="next" tabindex="0"><i class="fa fa-chevron-right" aria-hidden="true"></i>
	<div class="cycle-pager"></div>
	<p>Note that the chevrons do not require any additional JS for the browser to trigger when focused on (tabbed to) and pressing the the enter key. A tags with a href value automatically work with most browsers. However, the spans in this example are purposely not a tags with href values to demostrate the returnKepyress script.</p>



                //CSS isn't very important to this example. The good stuff is in the JS.
.cycle-slideshow {
	width: 100%;
	img {
		max-width: 100%;
#prev, #next {
	position: absolute;
	z-index: 105;
	top: 50%;
	font-size: 40px;
	color: white;
	text-shadow: 0px 1px 2px rgba(0, 0, 0, 0.77);
#prev {left: 0;}
#next {right: 0;}
article {
position: relative; 
	max-width: 960px;
	margin: auto;
.cycle-pager {
	font-size: 32px;
	text-align: center;
	margin-top: 15px;
	span { padding-left: 5px; padding-right: 5px;}
body {
	background: black;
	color: white;
	font-family: 'Merriweather', serif;
	-webkit-font-smoothing: antialiased;
	line-height: 1.4em;
	padding: 15px;
	font-size: 14px;


           +~+   ?DN                                        
        ::ND$COW..  7I=.                                   
              ?NMNMMMMNNDN:,,,DDDDNNNDNNN8,,,,,:. ~         
               =NNMNMNNNND:::::DDDDDDDDDDN,:,,,:  =         
                NNM=8~MMDO:::::DNNNDDD7=7::::,,:  +         
                .==~~:$COW~~~:::::DNNNNN::I,::,:  =         
                 .~~:~=N::D===~~~~~~~~NN:~~~::,:  =         
                  =~~I~:::D=+?+===~~~~~==~~~~+::  ,=        
                   =~?~::~   +==+====+.++++==.:::  ?=       
                    ::N:~                I~I= =::   ??.     
                    .:N:N                  7I .:~    .?:    
                    .::,D                  =+  ~~      ..   
                     :::                   ~=  :~           
                     ,::                   ~~  ::           
                     ,:,                   ==. ~~           
                    :,::                  OD.  =~           
                   Z$~::                      COW           



                //This is a simple script for accessibility, hitting return on UI elements triggers a click
(function(jQuery) {
	"use strict";
	var Engine;
	jQuery(document).ready(function() {
		Engine = {
			ui: {
				returnKeypress: function(whichelem) {
						$(whichelem).keypress(function(e) {
							if (e.which == 13) { //Enter key pressed
								$(this).click(); //Trigger click event
					} // return keypress
			} // ui
		}; // Engine
		//Note that smart CSS selectors with this script can save you a lot of erroreous instances of this script :)