forked from vanderlee/colorpicker
-
Notifications
You must be signed in to change notification settings - Fork 0
/
index.html
82 lines (72 loc) · 2.39 KB
/
index.html
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
69
70
71
72
73
74
75
76
77
78
79
80
81
82
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html>
<head>
<title>jqcp</title>
<!-- jQuery/jQueryUI (hosted) -->
<script src="https://ajax.googleapis.com/ajax/libs/jquery/1.6.2/jquery.js"></script>
<script src="https://ajax.googleapis.com/ajax/libs/jqueryui/1.8.16/jquery-ui.js"></script>
<script src="http://jqueryui.com/themeroller/themeswitchertool/"></script>
<link href="http://ajax.googleapis.com/ajax/libs/jqueryui/1.8.16/themes/ui-lightness/jquery-ui.css" rel="stylesheet" type="text/css"/>
<!--link href="aristo/Aristo.css" rel="stylesheet" type="text/css"/-->
<style>
body {
font-family: 'Segoe UI', Verdana, Arial, Helvetica, sans-serif;
font-size: 62.5%;
}
#switcher {
float: right;
display: inline-block;
}
</style>
<script src="jquery.colorpicker.js"></script>
<link href="jquery.colorpicker.css" rel="stylesheet" type="text/css"/>
<script>
$( function() {
$('#switcher').themeswitcher();
$('#cp1').colorpicker({
onClose: function(hex, rgba, inst) {
},
onSelect: function(hex, rgba, inst) {
//console.log(hex);
//console.log(rgba);
//console.log(inst);
},
showOn: 'both',
showHeader: true,
showSwatches: true,
buttonColorize: true,
altField: '.cp1-alt'
});
$('#cp2').colorpicker({
alpha: true,
showButtonPanel: true
});
var cpb = $('#cp-buttons').colorpicker({
showOn: '',
parts: ['bar', 'map']
});
$('#cp-button-open').click( function() {
cpb.colorpicker('open');
});
$('#cp-button-close').click( function() {
cpb.colorpicker('close');
});
$('#cp-button-disable').click( function() {
cpb.colorpicker('disable');
});
});
</script>
</head>
<body>
<div id="switcher"></div>
Color: <input type="color" id="cp1" value="ff9900"/>
<div class="cp1-alt" style="border: 1px inset; width: 200px; height: 40px;"></div>
<hr/>
Inline:<div id="cp2"></div>
<hr/>
Activated by buttons: <input type="color" id="cp-buttons" value="927abc"/>
<br/><button id="cp-button-open">Open</button>
<br/><button id="cp-button-close">Close</button>
<br/><button id="cp-button-disable">Disable</button>
</body>
</html>