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 8888 }
8989 } ) ;
9090
91+ // initialize with default options
9192 $ ( '#my-widget1' ) . colorize ( ) ;
93+
94+ // initialize with two customized options
9295 $ ( '#my-widget2' ) . colorize ( {
9396 red : 60 ,
9497 blue : 60
9598 } ) ;
99+
100+ // initialize with custom green value
101+ // and a random callback to allow only colors with enough green
96102 $ ( '#my-widget3' ) . colorize ( {
97103 green : 128 ,
98104 random : function ( event , ui ) {
99105 return ui . green > 128 ;
100106 }
101107 } ) ;
102108
109+ // click to toggle enabled/disabled
103110 $ ( '#disable' ) . toggle ( function ( ) {
104111 $ ( ':custom-colorize' ) . colorize ( 'disable' ) ;
105112 } , function ( ) {
106113 $ ( ':custom-colorize' ) . colorize ( 'enable' ) ;
107114 } ) ;
108115
116+ // click to set options after initalization
109117 $ ( '#black' ) . click ( function ( ) {
110118 $ ( ':custom-colorize' ) . colorize ( 'option' , {
111119 red : 0 ,
You can’t perform that action at this time.
0 commit comments