-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathindex.html
92 lines (81 loc) · 2.61 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
83
84
85
86
87
88
89
90
91
92
<!DOCTYPE HTML>
<html>
<head>
<title>jQuery.basicColorPicker</title>
<style>
/* This is the only thing needed for the picker
* Depending on the size here + the size of the color boxes (default 30px)
* You get: 120/30 = 4 colors/row
*/
#picker1, #picker2 {
width : 120px;
}
/******************************************
* Extra stuff used just in this demo page
******************************************/
body {
margin: 50px auto;
width : 720px;
}
/* http://nicolasgallagher.com/micro-clearfix-hack/ */
.group:before, .group:after {content: ""; display: table;}
.group:after {clear: both;}
#picker1 .item:hover, #picker2 .item:hover {
border: 1px solid white;
-moz-box-sizing: border-box;
-webkit-box-sizing: border-box;
box-sizing: border-box;
-o-transform: scale(1.2);
-ms-transform: scale(1.2);
-moz-transform: scale(1.2);
-webkit-transform: scale(1.2);
}
#picker1, #picker2, .menu {
border: 1px solid black;
margin: 2px;
}
.menu {
width : 120px;
cursor: pointer;
}
</style>
<script src="http://code.jquery.com/jquery-1.7.1.min.js"></script>
<script src="src/jQuery.basicColorPicker.js"></script>
</head>
<body>
<h1>jQuery.basicColorPicker()</h1>
<h5>Simple CallBack</h5>
<div>
<div class="menu" onclick="jQuery('#picker1').toggle();">X</div>
<div id="picker1" class="group"></div>
<pre>
jQuery("#picker1").basicColorPicker({}, function(color) {
alert(color);
});
</pre>
</div>
<h5>Event Binding</h5>
<div>
<div class="menu" onclick="jQuery('#picker2').toggle();">X</div>
<div id="picker2" class="group"></div>
<pre>
jQuery("#picker2").basicColorPicker();
jQuery("#picker2").bind("picker:selected", function(e) {
alert(e.color);
});
</pre>
</div>
<a href="https://github.com/itechnology/basicColorPicker">Source on Github</a>
<script>
jQuery(document).ready(function() {
jQuery("#picker1").basicColorPicker({}, function(color) {
alert(color);
});
jQuery("#picker2").basicColorPicker();
jQuery("#picker2").bind("picker:selected", function(e) {
alert(e.color);
});
});
</script>
</body>
</html>