Skip to content

Instantly share code, notes, and snippets.

@hcmn
hcmn / gist:3066669
Created July 7, 2012 14:33 — forked from shultzc/gist:2040478
Demo of elementary JavaScript DOM manipulation and event handling
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.1//EN" "http://www.w3.org/TR/xhtml11/DTD/xhtml11.dtd">
<html version="-//W3C//DTD XHTML 1.1//EN"
xmlns="http://www.w3.org/1999/xhtml" xml:lang="en"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://www.w3.org/1999/xhtml
http://www.w3.org/MarkUp/SCHEMA/xhtml11.xsd">
<head>
<style type="text/css">
#contentContainer {
@hcmn
hcmn / dabblet.css
Created July 7, 2012 14:42 — forked from fsunset/dabblet.css
Light social HTML5-CSS3 menu :)
/**
* Light social HTML5-CSS3 menu :)
*/
body{
background: rgb(110,70,70);
}
a{
color: white;
outline:none;
text-decoration: none;
@hcmn
hcmn / index.html
Created July 11, 2012 18:27
Recognize keypresses with Javascript & JQuery
<!DOCTYPE html>
<html>
<head>
<link rel="stylesheet" type="text/css" href="style.css" />
<script src="script.js"></script>
</head>
<body>
<div id ="a"></div>
<div id = "s"></div>
@hcmn
hcmn / index.html
Created July 11, 2012 18:44
JQuery: a custom event with click() & trigger()
<!DOCTYPE html>
<html>
<head>
<style>
p { color:red; }
span { color:blue; }
</style>
<script src="http://code.jquery.com/jquery-latest.js"></script>
</head>
<body>
@hcmn
hcmn / index.html
Created July 11, 2012 18:57
include JQuery UI via Google APIs
//JQuery UI library
<script src="http://ajax.googleapis.com/ajax/libs/jqueryui/1.8.18/jquery-ui.min.js" type="text/javascript">
//JQuery stylesheet
<link rel="stylesheet" type="text/css" href="http://ajax.googleapis.com/ajax/libs/jqueryui/1.7.1/themes/base/jquery-ui.css"/>
@hcmn
hcmn / addclass.css
Created July 11, 2012 19:18
JQuery UI: addClass
#button {
background:#f8f8f8;
width:100px;
padding:3pt;
text-align:center;
font-weight:bold;
-moz-border-radius:3pt;
-webkit-border-radius:3pt;
border-radius:3pt;
border: 2px #EEE solid;
@hcmn
hcmn / autocomplete-options.js
Created July 11, 2012 20:11
JQuery UI: Autocomplete
// This is the array we are going to use for our autocomplete text
// box. Notice, it's just one big array! This one for example is
// filled with a lot of names of programming languages.
var availableTags = [
"ActionScript",
"AppleScript",
"Asp",
"BASIC",
"C",
@hcmn
hcmn / index.html
Created July 11, 2012 20:15
JQuery UI: Datepicker
<html>
<head>
<title>Datepicker!</title>
<link rel="stylesheet" href="http://ajax.googleapis.com/ajax/libs/jqueryui/1.8.21/themes/base/jquery-ui.css"/>
</head>
<body>
<p>Date: <input type="text" id="dateEntry"></p>
</body>
<script src="https://ajax.googleapis.com/ajax/libs/jqueryui/1.8.18/jquery-ui.min.js" type="text/javascript"></script>
<script src="script.js"></script>
@hcmn
hcmn / index.html
Created July 11, 2012 20:27
JQuery UI: slider
<html>
<head>
<title>Sliders!</title>
<link rel="stylesheet" href="http://ajax.googleapis.com/ajax/libs/jqueryui/1.8.21/themes/base/jquery-ui.css"/>
<link rel="stylesheet" href="style.css"/>
</head>
<body>
<div class="panel">
<div id="slider"></div>
<p>
@hcmn
hcmn / index.html
Created July 11, 2012 20:40
JQuery UI: tabs
<html>
<head>
<title>Sliders!</title>
<link rel="stylesheet" href="http://ajax.googleapis.com/ajax/libs/jqueryui/1.8.21/themes/base/jquery-ui.css"/>
<link rel="stylesheet" href="style.css"/>
</head>
<body>
<div id="tabs">
<ul>
<li><a href="#tabs-1">Nunc tincidunt</a></li>