Skip to content

Instantly share code, notes, and snippets.

@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>
@srobbin
srobbin / gist:1980553
Created March 5, 2012 19:37
PageSlide Demo: Programmatically
<a href="javascript:$.pageslide({ direction: 'left', href:'_secondary.html' })">Link text</a>
@srobbin
srobbin / gist:2002330
Created March 8, 2012 17:51
Approach Demo: Grow and color
<!--
Notice that the size and color of the text above changes
as your cursor approaches it.
-->
<!-- Beginning styles -->
<style>
a#demo-link {
font-size: 24px;
color: #FFFFCC;
@srobbin
srobbin / gist:2002441
Created March 8, 2012 18:13
Approach Demo: Opacity
<!--
In this demo, there are a series of circular images.
Their opacity changes as you approach each individual one.
-->
<!-- Beginning styles -->
<style>
img.circle {
float: left;
height: 80px;
@srobbin
srobbin / gist:2014302
Created March 11, 2012 00:56
Disabling Backstretch for printing
<style media="print">
#backstretch { display: none; }
</style>
@font-face {
font-family: "Shifticons";
  src: url("../fonts/shifticons.eot"); /* IE9 Compat Modes */
  src: url("../fonts/shifticons.eot?#iefix") format("embedded-opentype"), /* IE6-IE8 */
       url("../fonts/shifticons.woff") format("woff"), /* Modern Browsers */
       url("../fonts/shifticons.ttf")  format("truetype"), /* Safari, Android, iOS */
       url("../fonts/shifticons.svg#Shifticons") format("svg"); /* Legacy iOS */
}
@srobbin
srobbin / 3d-css-book-covers.html
Created May 22, 2012 18:10
3D CSS Book Covers - HTML
<div id="book1" class="book">
<img src="book.jpg" />
</div>
@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>
@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: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");