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

Commit

Permalink
Browse files Browse the repository at this point in the history
  • Loading branch information
nils-soderman committed Jul 23, 2019
2 parents 1d20cb6 + e0ef6f5 commit 392c2c4
Showing 1 changed file with 6 additions and 6 deletions.
12 changes: 6 additions & 6 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -34,21 +34,21 @@ contextMenu.addItem("Hello World", function(){
// Examples of different ways to initialize a context menu:

// Initialize a context menu for the entire page
var contextMenu = CtxMenu();
var myContextMenu = CtxMenu();

// Initialize a context menu for a element defined by it's id
var contextMenu = CtxMenu("#example");
var myContextMenu = CtxMenu("#example");

// Initialize a context menu for a element defined by it's class
var contextMenu = CtxMenu(".example");
var myContextMenu = CtxMenu(".example");

// Initialize a context menu for all types of a certain element by using a nodeName
// The example below will create a context menu for all paragraphs on the page (<p></p>)
var contextMenu = CtxMenu("p");
var myContextMenu = CtxMenu("p");

// Initialize a context menu for a element variable
var myElement = document.getElementById("example");
var contextMenu = CtxMenu(myElement);
var myContextMenu = CtxMenu(myElement);
```

### CtxMenu Functions:
Expand Down Expand Up @@ -82,7 +82,7 @@ _Insert a new item into the menu at given position_
| icon | Url to an icon to be displayed before the text |

```javascript
myContextMenu.addItem(0, "Text Here", myFunction, "myIcon.png");
myContextMenu.insertItem(0, "Text Here", myFunction, "myIcon.png");
```


Expand Down

0 comments on commit 392c2c4

Please sign in to comment.