Skip to content

Instantly share code, notes, and snippets.

View jonraasch's full-sized avatar

Jon Raasch jonraasch

View GitHub Profile
@jonraasch
jonraasch / jQuery.support-transition.js
Created April 21, 2010 14:32
Extends the jQuery.support object to CSS3 transition
// jQuery.support.transition
// to verify that CSS3 transition is supported (or any of its browser-specific implementations)
$.support.transition = (function(){
var thisBody = document.body || document.documentElement,
thisStyle = thisBody.style,
support = thisStyle.transition !== undefined || thisStyle.WebkitTransition !== undefined || thisStyle.MozTransition !== undefined || thisStyle.MsTransition !== undefined || thisStyle.OTransition !== undefined;
return support;
})();
@jonraasch
jonraasch / jquery.json2.js
Created June 18, 2010 00:15
Adds JSON object support to browsers that don't support it natively. Uses the json2.js script from http://www.json.org , which is the same as is used by modern browsers.
// loads json2.js if JSON not supported
if ( typeof(JSON) == 'undefined' ) $.getScript('json2.js');
@jonraasch
jonraasch / clearfix.css
Created July 29, 2010 16:17
Alternative clearfix method
.clearfix:after{
visibility: hidden;
display: block;
font-size: 0;
content: " ";
clear: both;
height: 0;
}
.clearfix{ display: inline-block;}
@jonraasch
jonraasch / full-page-slider.html
Created September 2, 2010 22:06
Full page sliding animation
<?xml version="1.0" encoding="UTF-8"?>
<!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" xml:lang="en" lang="en">
<head>
<title>Full Page Slider</title>
<style type="text/css">
html {
@jonraasch
jonraasch / highlight.js
Created September 2, 2010 22:14
Live on-page text highlighting
/*
highlight v3 !! Modified by Jon Raasch (http://jonraasch.com) to fix IE6 bug !!
Highlights arbitrary terms.
<http://johannburkard.de/blog/programming/javascript/highlight-javascript-text-higlighting-jquery-plugin.html>
MIT license.
@jonraasch
jonraasch / drag-controls.html
Created September 2, 2010 22:28
Drag controls for oversized content
<?xml version="1.0" encoding="UTF-8"?>
<!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" xml:lang="en" lang="en">
<head>
<title>Drag Controls for Oversized Content</title>
<style type="text/css">
#full-sized-area {
position: relative;
@jonraasch
jonraasch / comment-count-bars.html
Created September 2, 2010 22:37
Comment count bars
<?xml version="1.0" encoding="UTF-8"?>
<!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" xml:lang="en" lang="en">
<head>
<title>Comment Count Bars</title>
<style type="text/css">
@jonraasch
jonraasch / subtle-mouse-effects.html
Created September 2, 2010 22:42
Subtle mouse effects
<?xml version="1.0" encoding="UTF-8"?>
<!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" xml:lang="en" lang="en">
<head>
<title>Subtle Mouse Effects</title>
<style type="text/css">
.subtle {
-webkit-transition: background-color 500ms ease-in; /* Saf3.2+, Chrome */
@jonraasch
jonraasch / force-chrome-frame.html
Created September 30, 2010 18:45
force chrome frame (via Paul Irish)
<head>
<meta http-equiv="X-UA-Compatible" content="IE=edge,chrome=1">
</head>
@jonraasch
jonraasch / extrude-on-hover.html
Created May 5, 2011 14:59
extrude text on hover
<!doctype html>
<html lang="en">
<head>
<title>Extruding Text on Hover (example)</title>
<style type="text/css">
body {
background-color: #444;