Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/konapun/jquery.context-menu.js
Turn an element into a context menu
https://github.com/konapun/jquery.context-menu.js
Last synced: 22 days ago
JSON representation
Turn an element into a context menu
- Host: GitHub
- URL: https://github.com/konapun/jquery.context-menu.js
- Owner: konapun
- Created: 2015-12-09T15:27:53.000Z (almost 9 years ago)
- Default Branch: master
- Last Pushed: 2015-12-09T15:28:13.000Z (almost 9 years ago)
- Last Synced: 2024-04-14T19:58:14.867Z (7 months ago)
- Language: JavaScript
- Size: 2.93 KB
- Stars: 0
- Watchers: 1
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
#jquery.context-menu.js
Treat an HTML element as a context menu## Usage
```html
...
``````js
var cm = $('#context-menu').contextMenu({
container: $('#menu-container')
});/* Optional show/hide on demand */
cm.show({ // manually give display coords
x: 0,
y: 0
});$('#menu-container').on('click', function(e) { // use an event to get coords for display
cm.show(e);
});
```## Options
* **container** [default: *undefined*]: An element which, when clicked on, automatically shows the context menu at the location where it was clicked
* **closeClass** [default: *menu-close*]: The class for an element which, when clicked on, will hide the context menu