Javascript Context Menu Click – Right-click anywhere on this page to bring up a custom context menu. CtxMenu is a dynamic, customizable context menu plugin to switch the native browser right-click menu.
How to make use of it:
Add the CtxMenu plugin’s JavaScript to the web page.
Create a new context menu for all the web pages.
var contextMenu = CtxMenu();
Add objects along with onClick capabilities, customized icons, checklist index to the context menu.
contextMenu.addItem("Item 1", function(){ // fired on click }); contextMenu.addItem("Item 2", function(){ // fired on click },Icon = "icon.png", 3);
Add a separator to the context menu.
contextMenu.addSeparator();
You can even connect the context menu to any container component you specify.
var contextMenu = CtxMenu("#myContainer");
How to Add a Custom Right-Click Menu, Context Menu on Right-Click, Change Right-Click Menu Color
Changelog:
07/23/2020
- Fixed typo addSeperator -> addSeparator
10/22/2019
- Fixed a place concern for pages with scrollbars
08/13/2019
- Removed CtxMenuItem class & modified some variables to constants
08/10/2019
- Fixed a difficulty that might break the menu if the web page had scrollbars
08/04/2019
- Added index choice to addSeperator()
08/02/2019
- added min & max width to the picture icon
08/01/2019
- The box-shadow now makes use of rgba as an alternative of hex
- Fixed components not being detected if it had a number of class names
See Demo And Download
Official Website(nils-soderman): Click Here
This superior jQuery/javascript plugin is developed by nils-soderman. For extra Advanced Usages, please go to the official website.
Be First to Comment