-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathindex.html
More file actions
68 lines (63 loc) · 2.81 KB
/
index.html
File metadata and controls
68 lines (63 loc) · 2.81 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
<?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 xmlns="http://www.w3.org/1999/xhtml">
<head>
<title>jQuery colorpicker</title>
<script src="http://www.google.com/jsapi"></script>
<script type="text/javascript" charset="utf-8">
google.load("jquery", "1.4.1");
</script>
<script src="jquery.mousewheel.js" type="text/javascript" charset="utf-8"></script>
<script src="jquery.colorpicker.js" type="text/javascript" charset="utf-8"></script>
</head>
<body>
<h1>jQuery colorpicker</h1>
<script type="text/javascript" charset="utf-8">
$(document).ready(function(){
// instantiate
picker = new jQuery.ColorPicker('#colorpicker', {
color: '#3d668a',
imagepath: '',
change: function(hex) {
$('#preview').css('background', hex);
$('#hex_input').val(hex);
}
});
// link text input back to picker
$('#hex_input').keyup(function(e){
if(e.which == 8
|| (48 <= e.which && e.which <= 57)
|| (97 <= e.which && e.which <= 102)) {
var hex = $(this).val();
picker.hex(hex);
};
});
});
</script>
<style type="text/css" media="screen">
#colorpicker_wrapper { float: left; margin: 2em; padding: 1ex; background: #808080;}
#preview { height: 24px; margin: 1ex; }
#form { margin: 1ex; color: #fff; }
</style>
<div id="colorpicker_wrapper">
<div id="preview"><!-- --></div>
<div id="colorpicker">
replaced content
</div>
<div id="form">
<label>Hexadecimal</label> <input type="text" id="hex_input" />
</div>
</div>
<h2>Scroll wheel</h2>
<p>Requires jquery.mousewheel.js (included). Degrades gracefully.</p>
<ul>
<li>H - Use the scroll wheel over the wheel while holding shift to adjust the Hue.</li>
<li>S - Use the scroll wheel over the wheel to adjust the Saturation.</li>
<li>V - Use the scroll wheel over the slider to adjust the Value.</li>
</ul>
<h2>Download / help out</h2>
<p>Project hosted at <a href="http://github.com/rennat/jQuery-ColorPicker/">github</a>.</p>
<p><a href="http://github.com/rennat/jQuery-ColorPicker/">http://github.com/rennat/jQuery-ColorPicker/</a></p>
</body>
</html>