Skip to content

Instantly share code, notes, and snippets.

View KruegerDesigns's full-sized avatar

Adam Krueger KruegerDesigns

View GitHub Profile
@KruegerDesigns
KruegerDesigns / play-pause.js
Created June 4, 2014 22:44
Pause all other HTML5 videos when a video is played
// Pause all other HTML5 videos when a video is played
$('video').click(function() {
$("video").each(function () { this.pause() });
});
@KruegerDesigns
KruegerDesigns / typography.css
Created April 15, 2014 21:20
Basic Content Spacing, Typography, Baseline Grid
.global-inline-styles {
h2 {
padding-bottom: .35em;
margin-top:0;
margin-bottom:0;
}
h3 {
padding-top: .25em;
padding-bottom: .25em;
margin-top:0;
@KruegerDesigns
KruegerDesigns / Placeholder-Polyfil
Created March 4, 2014 21:05
Placeholder jQuery Polyfil
<script type="text/javascript">
$(document).ready(function() {
//$('input').placeholder();
$('[placeholder]').focus(function() {
var input = $(this);
if (input.val() === input.attr('placeholder')) {
input.val('');
input.removeClass('placeholder');
}
}).blur(function() {
<?php
// Referrence: http://stackoverflow.com/questions/3161816/php-cut-a-string-after-x-characters
// Max allowed characters
$limit_max = 160;
// If limit exeeded, remove 3 characters to make room for trail
$limit_trail = $limit_max - 3;
@KruegerDesigns
KruegerDesigns / image_captions.html
Created August 7, 2013 16:19
Reference for image captions.
<!-- Pre HTML5 -->
<div class="img-caption" itemscope itemtype="http://schema.org/ImageObject">
<img src="" alt="" itemprop="contentURL">
<span itemprop="description">
Some image caption text.
</span>
</div>
<!-- Post HTML5 -->
<figure class="img-caption" itemscope itemtype="http://schema.org/ImageObject">
@KruegerDesigns
KruegerDesigns / sameHeight.js
Created January 11, 2013 16:53
Elements that need to match height can use this jQuery. Based on Chris Coyer's same height code, but modified for layouts using "box-sizing: border-box;".
// jQuery same height HTML elements, per a row.
$(window).load(function() {
var currentTallest = 0,
currentRowStart = 0,
rowDivs = new Array(),
$el,
topPosition = 0;
$('.blocks').each(function() {
@KruegerDesigns
KruegerDesigns / gist:3943098
Created October 24, 2012 01:10
Beautiful type, fixes for jQuery transitions and more! IE8
/* This is magic, makes the slide look beautiful in ie8 */
.ie8 slideshow-wrapper slide {
-ms-filter:"progid:DXImageTransform.Microsoft.Alpha(Opacity=99)";
}
@KruegerDesigns
KruegerDesigns / ios-fix-font-zoom.css
Created May 21, 2012 21:25
iPad/iPhone: fix font zooming
body { -webkit-text-size-adjust:100%; }
@KruegerDesigns
KruegerDesigns / android-content-resize-fix.css
Created May 21, 2012 21:22
Android: fix resizing of content area, add a transparent gif
.android #content >* {
background-image: url('http://d1xt3jhdg1opoa.cloudfront.net/transizr.gif');
}
@KruegerDesigns
KruegerDesigns / gist:2763436
Created May 21, 2012 17:31
Simple dynamic to static RewriteRule for .htaccess files.
# Will rewrite a dynamic URL to a static URL
RewriteRule /thing.*/stuff.html /new/location [R=301,L]