Ecosyste.ms: Awesome

An open API service indexing awesome lists of open source software.

Awesome Lists | Featured Topics | Projects

https://github.com/isaeken/jquery.context-menu

jQuery based context menus be like Material Design.
https://github.com/isaeken/jquery.context-menu

context-menu jquery material-design material-ui

Last synced: 2 days ago
JSON representation

jQuery based context menus be like Material Design.

Awesome Lists containing this project

README

        

# jQuery Context Menu
![jQuery Context Menu](https://i.imgyukle.com/2020/05/11/reOHzy.png)

## Usage

### with html

### with javascript



var contextMenu = $('#element').contextMenu();
contextMenu.button = mouseButton.LEFT;
contextMenu.menu().addItem('This is <b>first</b> item!');
contextMenu.menu().addItem('<b>Item</b> content', 'https://www.isaeken.com.tr');
contextMenu.menu().addItem('This is <u>Third</u> item', function () {
alert('Hello world!');
});
contextMenu.menu().addItem('<span class="material-icons">bookmark</span>Item with Material Icon');
contextMenu.menu().addItem('<i class="fab fa-npm"></i>Item with Font Awesome');
contextMenu.menu().addItem('Click to delete me!', function () {
contextMenu.menu().removeItem(5);
});
contextMenu.menu().addItem('Change trigger: <b>Mouse LEFT</b>', function () {
contextMenu.button = mouseButton.LEFT;
contextMenu.update();
});
contextMenu.menu().addItem('Change trigger: <b>Mouse MIDDLE</b>', function () {
contextMenu.button = mouseButton.MIDDLE;
contextMenu.update();
});
contextMenu.menu().addItem('Change trigger: <b>Mouse RIGHT</b>', function () {
contextMenu.button = mouseButton.RIGHT;
contextMenu.update();
});
contextMenu.menu().addItem('onclick event', function () {
contextMenu.onclick = function () {
$('#log').append('You are clicked!<br>');
this.close();
}
});
contextMenu.menu().addItem('onopen event', function () {
contextMenu.onopen = function () {
$('#log').append('Context menu opened!<br>');
}
});
contextMenu.init();