File tree Expand file tree Collapse file tree 1 file changed +8
-0
lines changed Expand file tree Collapse file tree 1 file changed +8
-0
lines changed Original file line number Diff line number Diff line change 88
88
}
89
89
} ) ;
90
90
91
+ // initialize with default options
91
92
$ ( '#my-widget1' ) . colorize ( ) ;
93
+
94
+ // initialize with two customized options
92
95
$ ( '#my-widget2' ) . colorize ( {
93
96
red : 60 ,
94
97
blue : 60
95
98
} ) ;
99
+
100
+ // initialize with custom green value
101
+ // and a random callback to allow only colors with enough green
96
102
$ ( '#my-widget3' ) . colorize ( {
97
103
green : 128 ,
98
104
random : function ( event , ui ) {
99
105
return ui . green > 128 ;
100
106
}
101
107
} ) ;
102
108
109
+ // click to toggle enabled/disabled
103
110
$ ( '#disable' ) . toggle ( function ( ) {
104
111
$ ( ':custom-colorize' ) . colorize ( 'disable' ) ;
105
112
} , function ( ) {
106
113
$ ( ':custom-colorize' ) . colorize ( 'enable' ) ;
107
114
} ) ;
108
115
116
+ // click to set options after initalization
109
117
$ ( '#black' ) . click ( function ( ) {
110
118
$ ( ':custom-colorize' ) . colorize ( 'option' , {
111
119
red : 0 ,
You can’t perform that action at this time.
0 commit comments