Create custom context menus easily
Create custom context menus easily
Import custoMenu :
<script src="path/to/custoMenu.js"></script>
<link href="path/to/custoMenu.css" rel="stylesheet" />
You can use jsDelivr links to keep updated your custoMenu : https://www.jsdelivr.com/package/gh/TheRolfFR/custoMenu
The menu itself has this these properties :
Required | Type | Desc | |
---|---|---|---|
name | X | String | Name of the custoMenu |
items | X | Object | Contains your items |
And each item has these properties :
Required | Type | Desc | |
---|---|---|---|
text | X | HTML | Text of the custoMenu item |
desc | String | Description of the custoMenu item | |
func | X | Function | Function associated to the custoMenu item |
Example :
var filectxmenu = {
name: 'file',
items: {
'openfile' : { // function name must be unique throught every object. If not the last function will be choosed
text: '<i class="material-icons"></i>',
desc: 'Open',
func: function() {
// your function
} // etc...
}
}
}
custoMenu.addMenu(filectxmenu);
<div class="custoMe" data-name="file">file.txt</div>
License: GNU Lesser General Public License v3.0