Skip to content

Instantly share code, notes, and snippets.

@clayb
clayb / gist:4163611
Created November 28, 2012 19:45
active state for advent calenar li
#advent-calendar ul li:active {
-webkit-box-shadow: none;
-moz-box-shadow: none;
box-shadow: none;
}
@clayb
clayb / gist:4206142
Created December 4, 2012 16:56
awf background email
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<title>African Wildlife Foundation</title>
<style type="text/css">html {
-webkit-text-size-adjust: none; /* Prevent font scaling in landscape */
-ms-text-size-adjust: none;
/* Force Hotmail to display emails at full width */
body{width:100% !important;} .ReadMsgBody{width:100%;} .ExternalClass{width:100%;}
@clayb
clayb / 4spaces_to_2spaces.sublime-macro
Last active December 21, 2015 11:28
Convert 4 spaces to 2 spaces in Sublime Text
[
{
"args": null,
"command": "select_all"
},
{
"args":
{
"set_translate_tabs": true
},
@clayb
clayb / gist:9370421
Created March 5, 2014 16:17
height spacer for BBNC and Outlook 2013
<!--horizontal spacer for BBNC and Outlook 2013-->
<tr>
<td height="14" style="height:14px !important;line-height:1px;font-size:0px;margin-auto:0px;mso-line-height-rule:exactly;"><span style="font-size:0;line-height:0;margin-auto:0px;mso-line-height-rule:exactly;">&nbsp;</span></td>
</tr>
@clayb
clayb / placeholder.js.coffee
Last active April 28, 2016 21:07
Form placeholder coffeescript
# placeholder for inputs in IE
unless Modernizr.input.placeholder
$('[placeholder]')
.focus ->
input = $(@)
if input.val() == input.attr('placeholder')
input.val('')
input.removeClass('placeholder')
.blur ->
input = $(@)
@clayb
clayb / placeholder.js
Last active April 8, 2016 15:55
placeholder js script
if (!Modernizr.input.placeholder) {
$('[placeholder]').focus(function() {
var input;
input = $(this);
if (input.val() === input.attr('placeholder')) {
input.val('');
return input.removeClass('placeholder');
}
}).blur(function() {
var input;
@clayb
clayb / nav-dropdown-on-scroll.js
Last active April 28, 2016 21:10
Navigation dropdown on page scroll
openDropdownNav = function() {
return $('header').addClass('dropdown-nav').slideDown();
};
closeDropdownNav = function() {
return $('header.dropdown-nav').slideUp(function() {
return $('header').removeClass('dropdown-nav').stop().removeAttr('style');
});
};
getDocHeight = function() {
var D;
$('a').each(function() {
if (location.search.substr(1) !== '') {
query = location.search.substr(1);
symbol = $(this).attr('href').indexOf("?") == -1 ? '?' : '&';
$(this).attr('href', $(this).attr('href') + symbol + query);
}
});
@clayb
clayb / main.scss
Created July 23, 2014 20:58 — forked from rattlion/main.scss
Compass sprite for loop example
@import "compass";
@import "compass/reset";
@import "icon/*.png";
@include all-icon-sprites;
@import "logo/*.png";
@include all-logo-sprites;
@import "pencil/*.png";
@include all-pencil-sprites;
@clayb
clayb / scroll-next-prev.js
Last active April 28, 2016 21:08
Scroll to Next or Previous <article> element
/**document ready**/
$(document).ready(function () {
/** scroll to element function **/
function scrollToElement(selector, time, verticalOffset) {
time = typeof (time) != 'undefined' ? time : 500;
verticalOffset = typeof (verticalOffset) != 'undefined' ? verticalOffset : 0;
element = $(selector);
offset = element.offset();
offsetTop = offset.top + verticalOffset;