
Yet another JavaScript right-click menu plugin designed to create custom context menus within specified areas of your website.
How to use it:
1. Load the required JavaScript and CSS files in the document.
<link rel="stylesheet" href="style.css"> <script src="RightMenu.js"></script>
2. Create an array of menu items as follows:
const myMenu = [
{
type: 'link',
title: 'CSSScript',
content: 'https://www.cssscript.com/',
target: '_blank'
},
{
type: 'separator',
},
{
type: 'function',
title: 'Alert',
content: () => alert(1)
},
{
type: 'link',
title: 'Disabled',
disabled: true
},
{
type: 'text',
title: 'Plain Text',
class: 'plain'
}
]3. Initialize the RightMenu.js and attach the context menu to the desired element.
new RightMenu('#targetElement', {
class: 'rightMenu',
items: myMenu,
});






