The original library providers attach
method to attach on elements. But
I wanna use this library with jit.js which already has event listeners.
To integrate these two, I don't wanna attach the context menu to a element's event,
I hope it can just showup a context menu when the onRightClick of jit.js triggers.
So I reused part of the attach
function codes and added a new method show
.
show(data, e)
data
the same data asattach
e
event object you can pass in from other event listeners
Context.js is a lightweight solution for contextual menus. Currently, there are two versions.
You can go to original author's website to see the details Visit the Website, lab.jakiestfu.com/contextjs/
- Linted: Valid JS
- Can be used with or without Twitters Bootstrap.css
- Icon support for menu items with Twitter Bootstrap icons
- Event Based Links
- Anchor Links
- Headers
- Dividers
- Recursive Menus (infinite depth)
- Vertical Space Detection (turns into a "dropup")
- Horizontal Space Detection (Drops to the left instead of right)
- Add/Delete menus Dynamically
- Even works on Inline Links
- Dynamic menu items through callbacks during menu creation