Skip to content

Commit c7c1689

Browse files
committed
Update README.md
1 parent 7fc904c commit c7c1689

File tree

1 file changed

+22
-16
lines changed

1 file changed

+22
-16
lines changed

README.md

Lines changed: 22 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -76,11 +76,14 @@ structure (see [jQueryUI menu] for details):
7676
<dl>
7777
<dt>delegate</dt>
7878
<dd>
79-
`{String}` jQuery selector describing the elements that trigger the context menu.
79+
Type: <code>String</code><br>
80+
A selector to filter the elements that trigger the context menu.
8081
</dd>
8182
<dt>menu</dt>
8283
<dd>
83-
`{String | jQuery | function}` jQuery object or selector (or function returning such) describing the menu definition.
84+
Type: <code>String | jQuery | function</code><br>
85+
jQuery object or selector (or function returning such) of HTML markup that defines the context menu
86+
structure (see [jQueryUI menu] for details).
8487
</dd>
8588
</dl>
8689

@@ -89,7 +92,8 @@ structure (see [jQueryUI menu] for details):
8992
<dl>
9093
<dt>open(target)</dt>
9194
<dd>
92-
Open context menu on a specific target (must match options.delegate).
95+
Open context menu on a specific target (target must match the options.delegate filter).<br>
96+
Call like <code>$(...).contextmenu("open", target);</code>.
9397
</dd>
9498
</dl>
9599

@@ -111,7 +115,7 @@ $("#container").contextmenu({
111115
});
112116
```
113117

114-
Alternatively a handler may be bound, so this is equivaent:
118+
Alternatively a handler may be bound, so this is equivalent:
115119
```js
116120
$("#container").bind("contextmenuselect", function(event, ui) {
117121
var menuId = ui.item.find(">a").attr("href"),
@@ -121,37 +125,39 @@ $("#container").bind("contextmenuselect", function(event, ui) {
121125
```
122126
123127
<dl>
124-
<dt>beforeopen(event)</dt>
128+
<dt>beforeOpen(event)</dt>
125129
<dd>
126-
Menu about to open; return `false` to prevent opening.
130+
Triggered just before the popup menu is opened.<br>
131+
Return <code>false</code> to prevent opening.
127132
</dd>
128133
<dt>blur(event, ui)</dt>
129134
<dd>
130-
menu option lost focus
135+
Triggered when the menu loses focus.
131136
</dd>
132-
<dt>close(event, ui)</dt>
137+
<dt>close(event)</dt>
133138
<dd>
134-
menu was closed
139+
Triggered when the menu is closed.
135140
</dd>
136141
<dt>create(event, ui)</dt>
137142
<dd>
138-
menu was initialized
143+
Triggered when the menu is created.
139144
</dd>
140145
<dt>focus(event, ui)</dt>
141146
<dd>
142-
menu option got focus
147+
Triggered when a menu gains focus or when any menu item is activated.
143148
</dd>
144-
<dt>init(event, ui)</dt>
149+
<dt>init(event)</dt>
145150
<dd>
146-
ui-contextmenu was initialized
151+
Triggered when the contextmenu widget is initialized.
147152
</dd>
148-
<dt>open(event, ui)</dt>
153+
<dt>open(event)</dt>
149154
<dd>
150-
menu was opened
155+
Triggered when the menu is opened.
151156
</dd>
152157
<dt>select(event, ui)</dt>
153158
<dd>
154-
menu option was selected; return `false` to prevent closing.
159+
Triggered when a menu item is selected.<br>
160+
Return <code>false</code> to prevent closing the menu.
155161
</dd>
156162
</dl>
157163

0 commit comments

Comments
 (0)