Skip to content


Subversion checkout URL

You can clone with
Download ZIP
contextMenu plugin & polyfill
tree: 5894468c31
Failed to load latest commit information.
.gitignore adding patch for firefox nightlies (FF8) and adding handling for FF-s…
docs.html necessary updates to docs and demo pages to reflect changes
jquery.contextMenu.css minor css update for opera
jquery.contextMenu.js further updates
jquery.contextMenu.min.js updating to ref latest jQuery
jquery.ui.position.js made positioning a configurable thing
screen.css necessary updates to docs and demo pages to reflect changes

jQuery contextMenu plugin & polyfill

Reasons for this fork:

1) The official release of $.contextMenu is missing a test to check for native support of contextmenu in the browser.

2) The Firefox nightlies implement contextmenu using the 'menuitem' tags for menu-structure. The specs however state that 'command' tags should be used for this purpose. Whilst the contextMenu plugin handles correct support for 'command' items, it doesn't for 'menuitem'. My fork handles this.

contextmenu specs

Original summary

$.contextMenu is a management facility for - you guessed it - context menus. It was designed for an application where there are hundreds of elements that may show a context menu - so intialization speed and memory usage are kept fairly small. It also allows to register context menus without providing actual markup, as $.contextMenu generates DOMElements as needed.

features - demo - documentation


  • jQuery 1.6 (not tested with older versions)
  • jQuery UI position (optional but recommended)


register contextMenu from javascript:

    // define which elements trigger this menu
    selector: ".with-cool-menu",
    // define the elements of the menu
    items: {
        foo: {name: "Foo", callback: function(key, opt){ alert("Foo!"); }},
        bar: {name: "Bar", callback: function(key, opt){ alert("Bar!") }}
    // there's more, have a look at the demos and docs…

import contextMenu from HTML5 <menu>:



use Google Closure Compiler:

// ==ClosureCompiler==
// @compilation_level SIMPLE_OPTIMIZATIONS
// @output_file_name contextMenu.js
// @code_url
// @code_url
// @code_url
// ==/ClosureCompiler==    


$.contextMenu is published under the MIT license.

Something went wrong with that request. Please try again.