4
4
< meta http-equiv ="content-type " content ="text/html; charset=ISO-8859-1 ">
5
5
< title > jquery.ui-contextmenu.js - Demo</ title >
6
6
7
- <!-- min requirements:
8
- <script src="http://code.jquery.com/jquery-1.7.js" type="text/javascript"></script>
9
- <script src="http://code.jquery.com/ui/1.9.0/jquery-ui.js" type="text/javascript"></script>
10
-
11
- <script src="https://ajax.googleapis.com/ajax/libs/jquery/1/jquery.min.js" type="text/javascript"></script>
12
- <script src="https://ajax.googleapis.com/ajax/libs/jqueryui/1/jquery-ui.min.js" type="text/javascript"></script>
13
- -->
14
- < link type ="text/css " rel ="stylesheet " href ="https://code.jquery.com/ui/1.11.0/themes/ui-lightness/jquery-ui.css " />
15
- < script src ="https://ajax.googleapis.com/ajax/libs/jquery/1/jquery.min.js " type ="text/javascript "> </ script >
16
- < script src ="https://code.jquery.com/ui/1.11.0/jquery-ui.min.js " type ="text/javascript "> </ script >
7
+ < link href ="//code.jquery.com/ui/1.10.4/themes/ui-lightness/jquery-ui.css " type ="text/css " rel ="stylesheet " />
8
+ < script src ="//code.jquery.com/jquery-1.10.2.min.js " type ="text/javascript "> </ script >
9
+ < script src ="//code.jquery.com/ui/1.10.4/jquery-ui.min.js " type ="text/javascript "> </ script >
17
10
18
11
<!-- Some custom library to enable 'taphold' events -->
19
12
< script src ="jquery-taphold/taphold.js " type ="text/javascript "> </ script >
51
44
width : 30px ;
52
45
}
53
46
54
- .ui-widget {
47
+ .ui-widget {
55
48
font-size : .8em ;
56
49
}
57
50
.ui-menu {
72
65
$ ( function ( ) {
73
66
/* Enable a themeroller theme-switching using a combobox. */
74
67
$ ( "#switcher" ) . themeswitcher ( {
75
- jqueryuiversion : "1.11.0 " ,
68
+ jqueryuiversion : "1" ,
76
69
imgpath : "../lib/Super-Theme-Switcher/images/" ,
77
70
loadTheme : "Smoothness"
78
71
} ) ;
91
84
{ title : "----" } ,
92
85
{ title : "More" , children : [
93
86
{ title : "Sub 1 (using callback)" , action : function ( event , ui ) { alert ( "action callback sub1" ) ; } } ,
94
- { title : "Sub 2" , cmd : "sub1 " }
87
+ { title : "Sub 2" , cmd : "sub2 " }
95
88
] }
96
89
] ,
97
90
// Handle menu selection to implement a fake-clipboard
134
127
135
128
$ ( "#container" ) . contextmenu ( {
136
129
delegate : ".hasmenu2" ,
130
+ hide : { effect : "explode" , duration : "slow" } ,
137
131
menu : "#options" ,
138
132
// position: {my: "left top", at: "left bottom"},
139
133
position : function ( event , ui ) {
140
134
return { my : "left top" , at : "left bottom" , of : ui . target } ;
141
135
} ,
142
136
preventSelect : true ,
143
- taphold : true ,
144
137
show : { effect : "fold" , duration : "slow" } ,
145
- hide : { effect : "explode" , duration : "slow" } ,
138
+ taphold : true ,
139
+ uiMenuOptions : { // Additional options, used when UI Menu is created
140
+ position : { my : "left top" , at : "right+10 top+10" }
141
+ } ,
146
142
focus : function ( event , ui ) {
147
143
var menuId = ui . item . find ( ">a" ) . attr ( "href" ) ;
148
144
$ ( "#info" ) . text ( "focus " + menuId ) ;
181
177
< h1 > jquery.ui-contextmenu.js</ h1 >
182
178
183
179
< p >
184
- <!--
185
- <a href="https://github.com/mar10/jquery-ui-contextmenu">View project on GitHub</a>
186
- —
187
- -->
188
- < a href ="index.html "> Demo with jQuery UI 1.10</ a >
180
+ < a href ="index.html "> Demo with jQuery UI 1.11</ a >
189
181
—
190
- < a href =" index-1-11.html " > Demo with jQuery UI 1.11 </ a >
182
+ < b > Demo with jQuery UI 1.10 </ b >
191
183
</ p >
192
184
193
185
< div >
194
186
< label for ="switcher "> Theme:</ label > < div id ="switcher "> </ div >
195
- <!--
196
- <label for="skinswitcher">Skin:</label> <select id="skinswitcher"></select>
197
- -->
198
187
</ div >
199
188
200
189
< h3 > Sample 1</ h3 >
@@ -219,7 +208,8 @@ <h3>Sample 2</h3>
219
208
< ul >
220
209
< li > Initialized by hidden <ul> element.
221
210
< li > Use custom show/hide effects.
222
- < li > Define custom position.
211
+ < li > Define custom position for initial popup.
212
+ < li > Define custom position for submenus.
223
213
</ ul >
224
214
< div id ="container ">
225
215
< span class ="hasmenu2 "> AAA</ span >
@@ -228,20 +218,20 @@ <h3>Sample 2</h3>
228
218
</ div >
229
219
230
220
< ul id ="options " style ="display: none; ">
231
- < li > < a href ="#action1 "> < span class ="ui-icon custom-icon-firefox "> </ span > Action 1</ a >
232
- < li > < a href ="#action2 "> < span class ="ui-icon ui-icon-heart "> </ span > Action 2</ a >
233
- < li class ="ui-state-disabled "> < a href ="#action3 "> Action 3</ a >
221
+ < li data-command =" action1 " > < a href ="# "> < span class ="ui-icon custom-icon-firefox "> </ span > Action 1</ a >
222
+ < li data-command =" action2 " > < a href ="# "> < span class ="ui-icon ui-icon-heart "> </ span > Action 2</ a >
223
+ < li data-command =" action3 " class ="ui-state-disabled "> < a href ="# "> Action 3</ a >
234
224
< li > ----
235
225
< li > < a > Extra</ a >
236
226
< ul >
237
- < li > < a href ="#action4 "> sub4</ a >
238
- < li > < a href ="#action5 "> sub5</ a >
227
+ < li data-command =" action4 " > < a href ="# "> sub4</ a >
228
+ < li data-command =" action5 " > < a href ="# "> sub5</ a >
239
229
</ ul >
240
230
</ ul >
241
231
242
232
< ul id ="options2 " class ="ui-helper-hidden ">
243
- < li > < a href ="#action2 "> < span class ="ui-icon ui-icon-heart "> </ span > Action 2</ a >
244
- < li class ="ui-state-disabled "> < a href ="#action3 "> Action 3</ a >
233
+ < li data-command =" action2 " > < a href ="#action2 "> < span class ="ui-icon ui-icon-heart "> </ span > Action 2</ a >
234
+ < li data-command =" action3 " class ="ui-state-disabled "> < a href ="# "> Action 3</ a >
245
235
</ ul >
246
236
247
237
< h3 > Sample 3</ h3 >
0 commit comments