Skip to content
This repository was archived by the owner on Jul 22, 2023. It is now read-only.

Commit 631b41b

Browse files
Update README.md
1 parent 18da7a8 commit 631b41b

File tree

1 file changed

+5
-18
lines changed

1 file changed

+5
-18
lines changed

README.md

Lines changed: 5 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,9 @@
11
# CtxMenu (Javascript)
22
Customizable right click context menus for your website.
33

4-
[demo (wip)](https://nilssoderman.com/code/ctxmenu)
4+
![preview](https://i.imgur.com/SaBFHEy.png)
5+
6+
[demo](https://nilssoderman.com/code/ctxmenu)
57

68
## Installation
79

@@ -54,7 +56,7 @@ var myContextMenu = CtxMenu(myElement);
5456
### CtxMenu Functions:
5557

5658
**addItem(**
57-
text, function, ?icon **)**
59+
text, function, ?icon, ?index **)**
5860

5961
_Appends a new item to the menu._
6062

@@ -63,28 +65,13 @@ _Appends a new item to the menu._
6365
| text | The text that will be displayed in the menu |
6466
| function | The function to be called when the item is clicked |
6567
| icon | Url to an icon to be displayed before the text |
68+
| index | The list index where to insert the item |
6669

6770
```javascript
6871
myContextMenu.addItem("Text Here", myFunction, "myIcon.png");
6972
```
7073

7174

72-
**insertItem(**
73-
index, text, function, ?icon **)**
74-
75-
_Insert a new item into the menu at given position_
76-
77-
| Arguments | Description |
78-
| --- | --- |
79-
| index | The list index where the item will be placed |
80-
| text | The text that will be displayed in the menu |
81-
| function | The function to be called when the item is clicked |
82-
| icon | Url to an icon to be displayed before the text |
83-
84-
```javascript
85-
myContextMenu.insertItem(0, "Text Here", myFunction, "myIcon.png");
86-
```
87-
8875

8976
**addSeperator()**
9077

0 commit comments

Comments
 (0)