Skip to content

Instantly share code, notes, and snippets.

@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 13:06
jQuery Plugin Workshop Adding in Options
<h2>Antispam</h2>
<p>Email me at <span class="antispam">scott at-symbol robbin dot co</span></p>
@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>
@srobbin
srobbin / index.html
Created March 18, 2013 22:52
A CodePen by douglasdeodato. Single Element Pure CSS MacBook Pro - This is just an experiment! There are certainly better ways to show an image of a MacBook, but none as fun as this :)
<i class="macbook"></i>
@srobbin
srobbin / gist:5165332
Last active December 14, 2015 23:28
Fix for multiple backstretch DIVs on subsequent calls
/*
* Backstretch
* http://srobbin.com/jquery-plugins/backstretch/
*
* Copyright (c) 2012 Scott Robbin
* Licensed under the MIT license.
*/
;(function ($, window, undefined) {
'use strict';
@srobbin
srobbin / gist:3799775
Created September 28, 2012 13:15
Random Backstretch image
<script>
// Create an array of images that you'd like to use
var images = [
'image1.jpg'
, 'image2.jpg'
, 'image3.jpg'
];
// Get a random number between 0 and the number of images
var randomNumber = Math.floor( Math.random() * images.length );
@srobbin
srobbin / gist:3668973
Last active March 25, 2018 13:00
On a block level element
/*
* If you'd like, you can attach Backstretch to any block-level element.
* For example, this demo.
*/
$("#demo").backstretch("images/garfield-interior.jpg");
@srobbin
srobbin / gist:2773397
Created May 23, 2012 05:22
Convenince gist for including Modernizr with 3D CSS Transforms
<script>
/* Modernizr 2.5.3 (Custom Build) | MIT & BSD
* Build: http://www.modernizr.com/download/#-csstransforms3d-shiv-cssclasses-teststyles-testprop-testallprops-prefixes-domprefixes-load
*/
;window.Modernizr=function(a,b,c){function z(a){j.cssText=a}function A(a,b){return z(m.join(a+";")+(b||""))}function B(a,b){return typeof a===b}function C(a,b){return!!~(""+a).indexOf(b)}function D(a,b){for(var d in a)if(j[a[d]]!==c)return b=="pfx"?a[d]:!0;return!1}function E(a,b,d){for(var e in a){var f=b[a[e]];if(f!==c)return d===!1?a[e]:B(f,"function")?f.bind(d||b):f}return!1}function F(a,b,c){var d=a.charAt(0).toUpperCase()+a.substr(1),e=(a+" "+o.join(d+" ")+d).split(" ");return B(b,"string")||B(b,"undefined")?D(e,b):(e=(a+" "+p.join(d+" ")+d).split(" "),E(e,b,c))}var d="2.5.3",e={},f=!0,g=b.documentElement,h="modernizr",i=b.createElement(h),j=i.style,k,l={}.toString,m=" -webkit- -moz- -o- -ms- ".split(" "),n="Webkit Moz O ms",o=n.split(" "),p=n.toLowerCase().split(" "),q={},r={},s={},t=[],u=t.slice,v,w=function(
@srobbin
srobbin / gist:2773148
Created May 23, 2012 03:44
3D CSS Book Covers (WebKit and Firefox)
<!-- Note: You'll have to use Modernizr to detect 3d transform support -->
<!--- HTML --->
<div class="books">
<div id="book1" class="book">
<img src="book4.jpg" />
</div>
<div id="book2" class="book">
<img src="book2.jpg" />
</div>