Project

General

Profile

Download (1.79 KB) Statistics
| Branch: | Tag: | Revision:
1
Color Picker
2
====================================================================================
3

    
4
http://www.eyecon.ro/colorpicker/#about
5

    
6

    
7

    
8
Implement
9
======================
10

    
11
Attach the Javascript and CSS files to your document. Edit CSS file and fix the paths 
12
to images and change colors to fit your site theme.
13

    
14
<link rel="stylesheet" media="screen" type="text/css" href="css/colorpicker.css" />
15
<script type="text/javascript" src="js/colorpicker.js"></script>
16
                
17

    
18
Invocation code
19
======================
20

    
21
All you have to do is to select the elements in a jQuery way and call the plugin.
22

    
23
 $('input').ColorPicker(options);
24
                
25

    
26
Options
27
======================
28

    
29
A hash of parameters. All parameters are optional.
30
eventName 	string 	The desired event to trigger the colorpicker. Default: 'click'
31
color 	string or hash 	The default color. String for hex color or hash for RGB and HSB ({r:255, r:0, b:0}) . Default: 'ff0000'
32
flat 	boolean 	Whatever if the color picker is appended to the element or triggered by an event. Default false
33
livePreview 	boolean 	Whatever if the color values are filled in the fields while changing values on selector or a field. If false it may improve speed. Default true
34
onShow 	function 	Callback function triggered when the color picker is shown
35
onBeforeShow 	function 	Callback function triggered before the color picker is shown
36
onHide 	function 	Callback function triggered when the color picker is hidden
37
onChange 	function 	Callback function triggered when the color is changed
38
onSubmit 	function 	Callback function triggered when the color it is chosen
39
Set color
40

    
41
If you want to set a new color.
42

    
43
$('input').ColorPickerSetColor(color);
44

    
45
The 'color' argument is the same format as the option color, string for hex color or hash for RGB and HSB ({r:255, r:0, b:0}).
    (1-1/1)