Simple jQuery Context Menu Using jQuery UI - CustomMenu

File Size: 4.36 KB
Views Total: 1841
Last Update:
Publish Date:
Official Website: Go to website
License: MIT
Simple jQuery Context Menu Using jQuery UI - CustomMenu

CustomMenu is a simple jQuery plugin that uses jQuery UI menu component to create a right-click context menu within any html element. The plugin comes with a filter option that allows menu to be linked to specific elements within the main item (ie cells within a table).

Basic Usage:

1. Include jQuery javascript library and jQuery customMenu plugin in the page.

<script src=""></script>
<script type="text/javascript" src="jquery_custommenu.js"></script>

2. Include jQuery UI's files in the page.

<link rel="stylesheet" type="text/css" href=""/> 
<script src=""></script>

3. Create a context menu within a container.

<p id="demo">
<span>Right Click Me</span>

4. Add the menu items in the javascript and call the plugin with options.

var options = [
	{id:5, label:'Brighton'},
	{id:6, label:'London'},
	{id:7, label:'Manchester'}

$(document).ready(function() {
filter: 'span',
option_list_callback: function() {
return options;

Change logs:


  • Update to handle clearing the menu better from within IE


  • Update to improve handling of mouse clicks which should hide the current menu


  • Update to style properly for jQuery UI 1.11.1


  • Update to return menu item selected

This awesome jQuery plugin is developed by ChrisWeller. For more Advanced Usages, please check the demo page or visit the official website.