Skip to content

Instantly share code, notes, and snippets.

<!doctype html>
<html>
<head>
<link href="ios-checkbox.css" type="text/css" rel="stylesheet">
</head>
<body>
<!-- Your awesome website goes here... -->
@jbail
jbail / ios-checkbox-impl1.js
Created January 9, 2013 13:16
Sample implementation of iOS Checkbox Plugin as applied to all checkbox inputs on the page
$(function () {
$('input[type=checkbox]').ioscheckbox();
});
@jbail
jbail / jquery-message-events.js
Created December 30, 2012 17:44
Listening for message events with jQuery
$(window).on('message', function (event) {
});
@jbail
jbail / window-post-message.js
Last active December 10, 2015 09:28
window.postMessage
//postMessage using an iFrame
var iframe = document.getElementById('my-iframe').contentWindow;
iframe.postMessage('good morning', 'http://jeffbail.com/');
//postMessage using a Window
var win = window.open('http://someawesomeurl.com', 'someawesomeurl');
win.postMessage('good evening', 'http://jeffbail.com/');
@jbail
jbail / querySelector-querySelectorAll.js
Created December 23, 2012 22:41
querySelector and querySelectorAll
var article = document.getElementById('article');
var p = article.querySelector('p'); //returns the first 'p' tag that's a child of the #article element
p = article.querySelectorAll('p'); //returns a NodeList containing all 'p' tags that are children of the #article element
@jbail
jbail / index.html
Created December 23, 2012 22:16
A CodePen by Jeff Bail.
<div class="info">
<p class="name">Jeff Bail</p>
<p class="address">
<span class="street">123 Awesome Ave</span>
<span class="city-state">Denver, CO</span>
<span class="country">United States</span>
</p>
<p class="tel">(XXX) XXX-XXXX</p>
</div>
@jbail
jbail / index.html
Created December 23, 2012 22:02
A CodePen by Jeff Bail.
<div class="info">
<p class="name">Jeff Bail</p>
<p class="address">
<span class="street">123 Awesome Ave</span>
<span class="city-state">Denver, CO</span>
<span class="country">United States</span>
</p>
<p class="tel">(XXX) XXX-XXXX</p>
</div>
@jbail
jbail / index.html
Created December 23, 2012 21:27
A CodePen by Jeff Bail.
<p><strong>Example 1</strong>: The link below will look good when hovered because the outline doesn't take up space.</p>
<p><a href="#" class="outline">I'm jumpy</a></p>
@jbail
jbail / index.html
Created December 23, 2012 21:24
A CodePen by Jeff Bail.
<p><strong>Example 1</strong>: The link below will be jumpy when hovered because borders take up space and there are none defined for the "off" state.</p>
<p><a href="#" class="border-jumpy">I'm jumpy</a></p>
<p><strong>Example 2</strong>: The link below has a transparent border in the "off" state, so it won't be jumpy when hovered.</p>
<p><a href="#" class="border-calm">I'm calm</a></p>
@jbail
jbail / index.html
Created December 23, 2012 21:08
A CodePen by Jeff Bail.
<p>Lorem ipsum dolor sit amet, consectetuer adipiscing elit, sed diam nonummy nibh euismod tincidunt ut laoreet dolore magna aliquam erat volutpat. Ut wisi <span class="inline-block"></span>enim ad minim veniam, quis nostrud exerci tation ullamcorper suscipit lobortis nisl ut aliquip ex ea commodo consequat. Duis autem vel eum iriure dolor in hendrerit in vulputate velit esse molestie consequat, vel illum dolore eu feugiat nulla facilisis at vero <span class="inline-block"></span>eros et accumsan et iusto odio dignissim qui blandit praesent luptatum zzril delenit augue duis dolore te feugait nulla facilisi. Nam liber tempor cum soluta nobis eleifend option <span class="inline-block"></span>congue nihil imperdiet doming id quod mazim placerat facer possim assum. Typi non habent claritatem insitam; est usus legentis in iis qui facit eorum claritatem. Investigationes demonstraverunt lectores legere me lius quod ii legunt saepius. Claritas est etiam processus dynamicus, qui <span class="inline-block"></span>sequi