Skip to content

Instantly share code, notes, and snippets.

@srobbin
srobbin / gist:1980518
Created March 5, 2012 19:31
PageSlide Demo: Secondary Page
<a href="_secondary.html" class="first">Link text</a>
<script>
$("a.first").pageslide();
</script>
@srobbin
srobbin / gist:1980526
Created March 5, 2012 19:32
PageSlide Demo: Modal
<a href="#modal" class="second">Link text</a>
<div id="modal" style="display:none">
<h2>Modal</h2>
<a href="javascript:$.pageslide.close()">Close</a>
</div>
<script>
$(".second").pageslide({ direction: "left", modal: true });
</script>
var position = 0,
images = [
'image1.jpg',
'image2.jpg',
'image3.jpg'
];
$.backstretch(images[position]);
setInterval(function() {
if(position++ > images.length) position = 0;
@srobbin
srobbin / gist:6893837
Created October 8, 2013 23:52
A quick workaround for Backstretch on iOS7
if (navigator.userAgent.match(/(iPad|iPhone);.*CPU.*OS 7_\d/i)) {
$("body").css({
"background": "url(path/to/image.jpg) center center no-repeat",
"background-size": "cover"
});
} else {
$.backstretch("path/to/image.jpg");
}
@srobbin
srobbin / gist:5990740
Created July 13, 2013 13:36
Semantic markup for The Starter League
<html>
<head>
<title>The Starter League</title>
</head>
<body>
<header>
<nav>
<a href="#">FAQ</a>
<a href="#">Blog</a>
<a href="https://twitter.com/starterleague">@StarterLeague</a>
@srobbin
srobbin / styles.css
Created April 18, 2013 23:46
A simple CSS tooltip
section {
font-family: Helvetica, sans-serif;
width: 960px;
margin: 50px auto 0 auto;
}
.tooltip {
display: none;
position: absolute;
background: black;
@srobbin
srobbin / index.html
Created March 19, 2013 17:02
jQuery Plugin Workshop Dropdown menu
<h2>Dropdown Menu</h2>
<div class="dropdown">
<a data-toggle="dropdown" href="#">Dropdown</a>
<ul class="dropdown-menu" role="menu" aria-labelledby="dLabel">
<li><a tabindex="-1" href="#">Action</a></li>
<li><a tabindex="-1" href="#">Another action</a></li>
<li><a tabindex="-1" href="#">Something else here</a></li>
<li class="divider"></li>
<li><a tabindex="-1" href="#">Separated link</a></li>
</ul>
@srobbin
srobbin / index.html
Created March 19, 2013 16:55
jQuery Plugin Workshop Box Color
<h2>Colors</h2>
<ul>
<li>1</li>
<li>2</li>
<li data-color="blue">3</li>
<li>4</li>
<li>5</li>
</ul>
@srobbin
srobbin / index.html
Created March 19, 2013 16:41
A CodePen by Scott Robbin. jQuery Plugin Workshop - A sandbox to show students the basics of jQuery plugin authoring.
<h2>Tooltips</h2>
<ul>
<li>
<a href="#" data-tooltip="This is the first tooltip">Tooltip 1</a>
</li>
<li>
<a href="#" data-tooltip="This is the second tooltip">Tooltip 2</a>
</li>
<li>
<a class="third" href="#">Tooltip 3</a>
@srobbin
srobbin / index.html
Created March 19, 2013 12:50
jQuery Plugin Workshop Antispam: Basic Plugin
<h2>Antispam</h2>
<p>Email me at <span class="antispam">scott at robbin dot co</span></p>