-
Notifications
You must be signed in to change notification settings - Fork 743
/
menu-title.html
476 lines (444 loc) · 25.8 KB
/
menu-title.html
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
<!DOCTYPE html>
<html>
<head>
<meta charset="utf-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>jQuery contextMenu (2.x)</title>
<link href='https://fonts.googleapis.com/css?family=Lato:400,700,400italic,700italic|Roboto+Slab:400,700|Inconsolata:400,700&subset=latin,cyrillic'
rel='stylesheet' type='text/css'>
<link rel="stylesheet" href="https://swisnl.github.io/jQuery-contextMenu/css/screen.css" type="text/css"/>
<link rel="stylesheet" href="https://swisnl.github.io/jQuery-contextMenu/css/theme.css" type="text/css"/>
<link rel="stylesheet" href="https://swisnl.github.io/jQuery-contextMenu/css/theme-fixes.css" type="text/css"/>
<link rel="stylesheet" href="//cdnjs.cloudflare.com/ajax/libs/highlight.js/8.4/styles/github.min.css">
<link href="https://swisnl.github.io/jQuery-contextMenu/dist/jquery.contextMenu.css" rel="stylesheet" type="text/css" />
<script src="https://cdnjs.cloudflare.com/ajax/libs/jquery/1.11.3/jquery.min.js"></script>
<script src="https://swisnl.github.io/jQuery-contextMenu/dist/jquery.contextMenu.js" type="text/javascript"></script>
<script src="https://swisnl.github.io/jQuery-contextMenu/dist/jquery.ui.position.min.js" type="text/javascript"></script>
<script src="https://swisnl.github.io/jQuery-contextMenu/js/main.js" type="text/javascript"></script>
<script type="text/javascript">
var _gaq = _gaq || [];
_gaq.push(['_setAccount', 'UA-66438984-1']);
_gaq.push(['_trackPageview']);
(function() {
var ga = document.createElement('script'); ga.type = 'text/javascript'; ga.async = true;
ga.src = ('https:' == document.location.protocol ? 'https://ssl' : 'http://www') + '.google-analytics.com/ga.js';
var s = document.getElementsByTagName('script')[0]; s.parentNode.insertBefore(ga, s);
})();
</script>
</head>
<body class="wy-body-for-nav">
<div class="wy-grid-for-nav">
<nav data-toggle="wy-nav-shift" class="wy-nav-side">
<div class="wy-side-nav-search">
<a href="https://swisnl.github.io/jQuery-contextMenu/"> jQuery contextMenu (2.x)</a>
</div>
<div class="wy-menu wy-menu-vertical" data-spy="affix" role="navigation" aria-label="main navigation">
<ul>
<li class="toctree-l1 ">
<a class="reference internal "
href="https://swisnl.github.io/jQuery-contextMenu//">
Introduction
</a>
<ul>
<li class="toctree-l2 ">
<a class="reference internal "
href="https://www.swis.nl/over-ons/bjorn-brala">
Author
</a>
</li>
<li class="toctree-l2 ">
<a class="reference internal "
href="https://swisnl.github.io/jQuery-contextMenu/demo.html">
Demo
</a>
</li>
</ul>
</li>
<li class="toctree-l1 ">
<a class="reference internal "
href="https://swisnl.github.io/jQuery-contextMenu/docs.html">
Documentation
</a>
<ul>
<li class="toctree-l2 ">
<a class="reference internal "
href="https://swisnl.github.io/jQuery-contextMenu/docs.html">
Options
</a>
</li>
<li class="toctree-l2 ">
<a class="reference internal "
href="https://swisnl.github.io/jQuery-contextMenu/docs/items.html">
Defining menu items
</a>
</li>
<li class="toctree-l2 ">
<a class="reference internal "
href="https://swisnl.github.io/jQuery-contextMenu/docs/plugin-commands.html">
Plugin commands
</a>
</li>
<li class="toctree-l2 ">
<a class="reference internal "
href="https://swisnl.github.io/jQuery-contextMenu/docs/customize.html">
Customize icons
</a>
</li>
<li class="toctree-l2 ">
<a class="reference internal "
href="https://swisnl.github.io/jQuery-contextMenu/demo/fontawesome-icons.html">
FontAwesome icons
</a>
</li>
<li class="toctree-l2 ">
<a class="reference internal "
href="https://swisnl.github.io/jQuery-contextMenu/docs/font-awesome.html">
Font Awesome support
</a>
</li>
<li class="toctree-l2 ">
<a class="reference internal "
href="https://swisnl.github.io/jQuery-contextMenu/docs/runtime-options.html">
Runtime options
</a>
</li>
<li class="toctree-l2 ">
<a class="reference internal "
href="https://swisnl.github.io/jQuery-contextMenu/docs/custom-command-types.html">
Custom command types
</a>
</li>
<li class="toctree-l2 ">
<a class="reference internal "
href="https://swisnl.github.io/jQuery-contextMenu/docs/events.html">
Events
</a>
</li>
<li class="toctree-l2 ">
<a class="reference internal "
href="https://swisnl.github.io/jQuery-contextMenu/docs/html5-polyfill.html">
HTML5 polyfill
</a>
</li>
</ul>
</li>
<li class="toctree-l1 current">
<a class="reference internal "
href="https://swisnl.github.io/jQuery-contextMenu/demo.html">
Demo gallery
</a>
<ul>
<li class="toctree-l2 ">
<a class="reference internal "
href="https://swisnl.github.io/jQuery-contextMenu/demo.html">
Simple Context Menu
</a>
</li>
<li class="toctree-l2 ">
<a class="reference internal "
href="https://swisnl.github.io/jQuery-contextMenu/demo/fontawesome-icons.html">
FontAwesome icons
</a>
</li>
<li class="toctree-l2 ">
<a class="reference internal "
href="https://swisnl.github.io/jQuery-contextMenu/demo/accesskeys.html">
Accesskeys
</a>
</li>
<li class="toctree-l2 ">
<a class="reference internal "
href="https://swisnl.github.io/jQuery-contextMenu/demo/async-create.html">
Create Context Menu (asynchronous)
</a>
</li>
<li class="toctree-l2 ">
<a class="reference internal "
href="https://swisnl.github.io/jQuery-contextMenu/demo/async-promise.html">
Create Context Menu (promise)
</a>
</li>
<li class="toctree-l2 ">
<a class="reference internal "
href="https://swisnl.github.io/jQuery-contextMenu/demo/callback.html">
Command's action (callbacks)
</a>
</li>
<li class="toctree-l2 ">
<a class="reference internal "
href="https://swisnl.github.io/jQuery-contextMenu/demo/custom-command.html">
Custom Command Types
</a>
</li>
<li class="toctree-l2 ">
<a class="reference internal "
href="https://swisnl.github.io/jQuery-contextMenu/demo/disabled.html">
Disabled Command
</a>
</li>
<li class="toctree-l2 ">
<a class="reference internal "
href="https://swisnl.github.io/jQuery-contextMenu/demo/disabled-callback.html">
Disabled Callback Command
</a>
</li>
<li class="toctree-l2 ">
<a class="reference internal "
href="https://swisnl.github.io/jQuery-contextMenu/demo/disabled-changing.html">
Changing Command's disabled status
</a>
</li>
<li class="toctree-l2 ">
<a class="reference internal "
href="https://swisnl.github.io/jQuery-contextMenu/demo/disabled-menu.html">
Disabled Menu
</a>
</li>
<li class="toctree-l2 ">
<a class="reference internal "
href="https://swisnl.github.io/jQuery-contextMenu/demo/dynamic.html">
Adding new Context Menu Triggers
</a>
</li>
<li class="toctree-l2 ">
<a class="reference internal "
href="https://swisnl.github.io/jQuery-contextMenu/demo/dynamic-create.html">
Create Context Menu on demand
</a>
</li>
<li class="toctree-l2 ">
<a class="reference internal "
href="https://swisnl.github.io/jQuery-contextMenu/demo/html5-import.html">
Importing HTML5 menu
</a>
</li>
<li class="toctree-l2 ">
<a class="reference internal "
href="https://swisnl.github.io/jQuery-contextMenu/demo/html5-polyfill.html">
HTML5 polyfill
</a>
</li>
<li class="toctree-l2 ">
<a class="reference internal "
href="https://swisnl.github.io/jQuery-contextMenu/demo/html5-polyfill-firefox8.html">
HTML5 polyfill (Firefox)
</a>
</li>
<li class="toctree-l2 ">
<a class="reference internal "
href="https://swisnl.github.io/jQuery-contextMenu/demo/input.html">
Input Commands
</a>
</li>
<li class="toctree-l2 ">
<a class="reference internal "
href="https://swisnl.github.io/jQuery-contextMenu/demo/keeping-contextmenu-open.html">
Keeping the context menu open
</a>
</li>
<li class="toctree-l2 current">
<a class="reference internal current"
href="https://swisnl.github.io/jQuery-contextMenu/demo/menu-title.html">
Menus with titles
</a>
</li>
<li class="toctree-l2 ">
<a class="reference internal "
href="https://swisnl.github.io/jQuery-contextMenu/demo/on-dom-element.html">
Context Menu on DOM Element
</a>
</li>
<li class="toctree-l2 ">
<a class="reference internal "
href="https://swisnl.github.io/jQuery-contextMenu/demo/sub-menus.html">
Submenus
</a>
</li>
<li class="toctree-l2 ">
<a class="reference internal "
href="https://swisnl.github.io/jQuery-contextMenu/demo/trigger-custom.html">
Custom Activated Context Menu
</a>
</li>
<li class="toctree-l2 ">
<a class="reference internal "
href="https://swisnl.github.io/jQuery-contextMenu/demo/trigger-hover.html">
Hover Activated Context Menu
</a>
</li>
<li class="toctree-l2 ">
<a class="reference internal "
href="https://swisnl.github.io/jQuery-contextMenu/demo/trigger-hover-autohide.html">
Hover Activated Context Menu With Autohide
</a>
</li>
<li class="toctree-l2 ">
<a class="reference internal "
href="https://swisnl.github.io/jQuery-contextMenu/demo/trigger-left-click.html">
Left-Click Trigger
</a>
</li>
<li class="toctree-l2 ">
<a class="reference internal "
href="https://swisnl.github.io/jQuery-contextMenu/demo/trigger-swipe.html">
Swipe Trigger
</a>
</li>
</ul>
</li>
</ul>
<div class="swis-branding">
<span>Maintained by:</span>
<a href="https://www.swis.nl"><img src="https://swisnl.github.io/jQuery-contextMenu/images/swis-logo.png" class="swis-logo">Creative Digital Agency</a>
</div>
</div>
</nav>
<section data-toggle="wy-nav-shift" class="wy-nav-content-wrap">
<nav class="wy-nav-top" role="navigation" aria-label="top navigation">
<i data-toggle="wy-nav-top" class="fa fa-bars"></i>
<a href="https://swisnl.github.io/jQuery-contextMenu/">jQuery contextMenu (2.x)</a>
</nav>
<div class="wy-nav-content">
<div class="rst-content">
<div role="main" class="document">
<a href="https://github.com/swisnl/jQuery-contextMenu" class="edit-on-github fa fa-github"> Fork on GitHub</a>
<h1 id="demo-menu-title">Demo: Menu Title</h1>
<!-- START doctoc generated TOC please keep comment here to allow auto update -->
<!-- DON'T EDIT THIS SECTION, INSTEAD RE-RUN doctoc TO UPDATE -->
<ul>
<li><a href="#example-css">Example CSS</a></li>
<li><a href="#example-code">Example code</a></li>
<li><a href="#example-html">Example HTML</a></li>
</ul>
<!-- END doctoc generated TOC please keep comment here to allow auto update -->
<p><span class="context-menu-one btn btn-neutral">right click me</span>
<span class="context-menu-two btn btn-neutral">right click me</span>
<span class="context-menu-three btn btn-neutral">right click me</span></p>
<h2 id="example-css">Example CSS</h2>
<style type="text/css" class="showcase">
/* menu header */
.css-title:before {
content: "some CSS title";
display: block;
position: absolute;
top: 0;
right: 0;
left: 0;
background: #DDD;
padding: 2px;
font-family: Verdana, Arial, Helvetica, sans-serif;
font-size: 11px;
font-weight: bold;
}
.css-title :first-child {
margin-top: 20px;
}
/* menu header via data attribute */
.data-title:before {
content: attr(data-menutitle);
display: block;
position: absolute;
top: 0;
right: 0;
left: 0;
background: #DDD;
padding: 2px;
font-family: Verdana, Arial, Helvetica, sans-serif;
font-size: 11px;
font-weight: bold;
}
.data-title :first-child {
margin-top: 20px;
}
</style>
<h2 id="example-code">Example code</h2>
<script type="text/javascript" class="showcase">
$(function(){
// register regular menu
$.contextMenu({
selector: '.context-menu-one',
callback: function(key, options) {
var m = "clicked: " + key;
window.console && console.log(m) || alert(m);
},
items: {
"edit": {name: "Edit", icon: "edit"},
"cut": {name: "Cut", icon: "cut"},
"copy": {name: "Copy", icon: "copy"},
"paste": {name: "Paste", icon: "paste"},
"delete": {name: "Delete", icon: "delete"},
"sep1": "---------",
"quit": {name: "Quit", icon: function($element, key, item){ return 'context-menu-icon context-menu-icon-quit'; }}
}
});
// register menu with title provided by CSS
$.contextMenu({
selector: '.context-menu-two',
className: 'css-title',
callback: function(key, options) {
var m = "clicked: " + key;
window.console && console.log(m) || alert(m);
},
items: {
"edit": {name: "Edit", icon: "edit"},
"cut": {name: "Cut", icon: "cut"},
"copy": {name: "Copy", icon: "copy"},
"paste": {name: "Paste", icon: "paste"},
"delete": {name: "Delete", icon: "delete"},
"sep1": "---------",
"quit": {name: "Quit", icon: function($element, key, item){ return 'context-menu-icon context-menu-icon-quit'; }}
}
});
// register menu with title provided by data-attribute
$.contextMenu({
selector: '.context-menu-three',
className: 'data-title',
callback: function(key, options) {
var m = "clicked: " + key;
window.console && console.log(m) || alert(m);
},
items: {
"edit": {name: "Edit", icon: "edit"},
"cut": {name: "Cut", icon: "cut"},
"copy": {name: "Copy", icon: "copy"},
"paste": {name: "Paste", icon: "paste"},
"delete": {name: "Delete", icon: "delete"},
"sep1": "---------",
"quit": {name: "Quit", icon: function($element, key, item){ return 'context-menu-icon context-menu-icon-quit'; }}
}
});
// set a title
$('.data-title').attr('data-menutitle', "Some JS Title");
});
</script>
<h2 id="example-html">Example HTML</h2>
<pre><code class="language-html"><span class="context-menu-one btn btn-neutral">right click me</span>
<span class="context-menu-two btn btn-neutral">right click me</span>
<span class="context-menu-three btn btn-neutral">right click me</span></code></pre>
</div>
<footer>
<hr/>
<div role="contentinfo">
<p>
Find jQuery contextMenu (2.x) on <a href="https://github.com/swisnl/jQuery-contextMenu">GitHub</a>.
</p>
</div>
</footer>
</div>
</div>
</section>
</div>
<script src="//netdna.bootstrapcdn.com/bootstrap/3.1.1/js/bootstrap.min.js"></script>
<script src="//cdnjs.cloudflare.com/ajax/libs/highlight.js/8.4/highlight.min.js"></script>
<script src="https://swisnl.github.io/jQuery-contextMenu/js/theme.js"></script>
<script>
$(function() {
hljs.configure({
tabReplace: ' ', // 4 spaces
});
hljs.initHighlightingOnLoad();
});
</script>
</body>
</html>