You should be knowing that the context menu offers a limited set of choices that are available in the current state, or context, of the operating system or application. The easiest way to define a context menu is to use JSON to define the options. The JSON structure is simply an Array with the options specified in order. The following example that I have provided demonstrates the same :
Code:
var menu1 = [
{'Option 1':function(menuItem,menu) { alert("You clicked first option!"); } },
$.contextMenu.separator,
{'Option 2':function(menuItem,menu) { alert("You clicked second option"); } }
];
$(function()
{
$('.cmenu1').contextMenu(menu1,{theme:'Windows7});
});
Bookmarks