Skip to content

Instantly share code, notes, and snippets.

View rblakejohnson's full-sized avatar

Blake Johnson rblakejohnson

View GitHub Profile
@rblakejohnson
rblakejohnson / new_gist_file
Created July 1, 2013 17:25
CSS: Link list
.link-list a {
display: block;
padding: 5px 0;
line-height: 1.4;
}
@rblakejohnson
rblakejohnson / new_gist_file
Created August 6, 2013 22:26
CSS property order example
.selector {
/* positioning */
position: absolute;
z-index: 10;
top: 0;
left: 0;
display: inline-block;
overflow: hidden;
width: 100px;
padding: 10px;
@rblakejohnson
rblakejohnson / new_gist_file
Created August 8, 2013 14:45
site container
.container {
max-width: 1000px;
margin: 1em auto;
}
@rblakejohnson
rblakejohnson / new_gist_file
Created August 15, 2013 21:13
Truncate line of text
.truncate {
width: 250px;
white-space: nowrap;
overflow: hidden;
text-overflow: ellipsis;
}
@rblakejohnson
rblakejohnson / gist:6370315
Created August 28, 2013 19:38 — forked from erunyon/gist:5509414
Markup for titles and subtitles for news. Could use with teaser pattern.
<p>News:</p>
<article>
<header>
<h1 class="entry-title"><a href="/news/hey-look-it-s-news/">Sample News Story</a></h1>
<h2 class="publish-info"><time class="pubdate" datetime="2010-08-31T10:00:00-05:00"><b>Published:</b> August 31, 2010</time></h2>
<h3 class="author"><b>Author:</b> Erik Runyon</h3>
</header>
</article>
<p>Events:</p>
@rblakejohnson
rblakejohnson / js: setTimeout
Created August 30, 2013 20:37
JS: setTimeout
window.setTimeout(
function() {
},
1000
);
@rblakejohnson
rblakejohnson / new_gist_file
Created September 4, 2013 21:06
HTML: Kitchen sink
<!DOCTYPE html>
<!--[if lt IE 7]> <html class="no-js lt-ie9 lt-ie8 lt-ie7"> <![endif]-->
<!--[if IE 7]> <html class="no-js lt-ie9 lt-ie8"> <![endif]-->
<!--[if IE 8]> <html class="no-js lt-ie9"> <![endif]-->
<!--[if gt IE 8]><!--> <html class="no-js"> <!--<![endif]-->
<head>
<meta charset="utf-8">
<meta http-equiv="X-UA-Compatible" content="IE=edge">
<title></title>
<meta name="description" content="">
@rblakejohnson
rblakejohnson / new_gist_file
Created September 11, 2013 15:19
JS: animated scroll
$('a').on('click', function() {
$('html,body').animate({
scrollTop: $('.box').offset().top - 10
}, 200);
});
@rblakejohnson
rblakejohnson / new_gist_file.js
Created September 23, 2013 16:01
JS: FAQ toggle and close
$('.question').on('click', function(e) {
e.preventDefault();
var self = $(this);
self.toggleClass("active").next().slideToggle(350);
});
$('.answer .close').on('click', function(e) {
e.preventDefault();
var answer = $(this).parents(".answer");
answer.slideUp(350);
@rblakejohnson
rblakejohnson / new_gist_file.js
Created September 23, 2013 22:20
JS: browser detect
(function(){
var putHere = $("html"),
curBrowser;
if($.browser.msie){
curBrowser = "ie";
putHere.addClass("ie"+parseInt($.browser.version,10));
}
if($.browser.webkit){
curBrowser = "webkit";