Skip to content

Instantly share code, notes, and snippets.

View freshyill's full-sized avatar
💭
😎 Cool

Chris Coleman freshyill

💭
😎 Cool
View GitHub Profile
@freshyill
freshyill / alert.js
Created September 2, 2011 01:05
Simple IE 6 alert with conditional comments and jQuery
$('document').ready(function(){
// Grab the message from the text file
var ie6message = 'alert.txt';
// Create a div to hold the alert
var alertdiv = $('<div id="alert">');
// Load the message into the div
alertdiv.load(ie6message);
// Insert the message into the page. Notice the .ie6 class, which only appears when using IE 6.
$('.ie6 body').prepend(alertdiv);
});
@freshyill
freshyill / fancyform
Created August 17, 2011 18:57
Fancy show/hide form with CSS3 and jQuery
<!doctype html>
<html>
<head>
<style type="text/css">
body {background: #333; font-family: Helvetica; padding: 20px;}
.container {width: 80%; margin: 20px auto; padding: 0; position: relative;}
article {background: #666; margin: 0; padding: 50px; border-radius: 4px; box-shadow: 0 0 15px #000, 0 1px 1px rgba(0,0,0,.7), 0 1px 0 rgba(255,255,255,0.3) inset; position: relative; -webkit-perspective: 1000; z-index: 2; color: #fff; text-shadow: 0 1px 1px rgba(0,0,0,.5);}
@freshyill
freshyill / wpcustompostclass.php
Created August 17, 2011 05:36
Add a custom post class in WordPress
<?php // First, create a custom field named 'custom_class' in WordPress and give it a value ?>
<?php // The Loop...
if (have_posts()) : ?>
<?php while (have_posts()) : the_post(); ?>
<?php // Declare a variable using the custom field
$custom_classes = get_post_meta($post->ID, 'custom_class', false); ?>