File tree Expand file tree Collapse file tree 1 file changed +22
-4
lines changed Expand file tree Collapse file tree 1 file changed +22
-4
lines changed Original file line number Diff line number Diff line change 6
6
< link rel ="stylesheet " href ="../../themes/base/jquery.ui.all.css ">
7
7
< script src ="../../jquery-1.5.1.js "> </ script >
8
8
< script src ="../../ui/jquery.ui.core.js "> </ script >
9
- < script src ="../../ui/jquery.ui.widget.js "> </ script >
10
9
< script src ="../../ui/jquery.ui.position.js "> </ script >
10
+ < script src ="../../ui/jquery.ui.widget.js "> </ script >
11
+ < script src ="../../ui/jquery.ui.button.js "> </ script >
11
12
< link rel ="stylesheet " href ="../demos.css ">
12
13
< style >
13
14
.custom-colorize {
14
- font-size : 25px ;
15
+ font-size : 20px ;
16
+ position : relative;
15
17
width : 75px ;
16
18
height : 75px ;
17
19
}
20
+ .custom-colorize-changer {
21
+ font-size : 10px ;
22
+ position : absolute;
23
+ right : 0 ;
24
+ bottom : 0 ;
25
+ }
18
26
</ style >
19
27
< script >
20
28
$ ( function ( ) {
40
48
// prevent double click to select text
41
49
. disableSelection ( ) ;
42
50
43
- // bind click events to random method
44
- this . _bind ( {
51
+ this . changer = $ ( "<button>" , {
52
+ text : "change" ,
53
+ className : "custom-colorize-changer"
54
+ } )
55
+ . appendTo ( this . element )
56
+ . button ( ) ;
57
+
58
+ // bind click events on the changer button to the random method
59
+ this . _bind ( this . changer , {
45
60
// _bind won't call random when widget is disabled
46
61
click : "random"
47
62
} ) ;
78
93
// events bound via _bind are removed automatically
79
94
// revert other modifications here
80
95
_destroy : function ( ) {
96
+ // remove generated elements
97
+ this . changer . remove ( ) ;
98
+
81
99
this . element
82
100
. removeClass ( "custom-colorize" )
83
101
. enableSelection ( )
You can’t perform that action at this time.
0 commit comments