Skip to content


Subversion checkout URL

You can clone with
Download ZIP
Fetching contributors…

Cannot retrieve contributors at this time

executable file 90 lines (75 sloc) 5.077 kB
<!DOCTYPE html>
<html xmlns="" xml:lang="de" lang="de">
<meta charset="utf-8" />
<meta http-equiv="content-type" content="text/html; charset=utf-8" />
<title>jQuery contextMenu Plugin</title>
<meta name="description" content="simple contextMenu generator for interactive web applications based on jQuery" />
<link href="screen.css" rel="stylesheet" type="text/css" />
<script type="text/javascript">
var _gaq = _gaq || [];
_gaq.push(['_setAccount', 'UA-8922143-3']);
(function() {
var ga = document.createElement('script'); ga.type = 'text/javascript'; ga.async = true;
ga.src = ('https:' == document.location.protocol ? 'https://ssl' : 'http://www') + '';
var s = document.getElementsByTagName('script')[0]; s.parentNode.insertBefore(ga, s);
<a id="github-forkme" href=""><img src="" alt="Fork me on GitHub" /></a>
<div id="container">
<h1><a href="">jQuery contextMenu</a></h1>
<ul class="menu">
<li class="active"><a href="index.html">About</a></li>
<li><a href="demo.html">Demo</a></li>
<li><a href="docs.html">Documentation</a></li>
<li><a href="">Author</a></li>
<img src="screenshots/jquery-contextMenu.subs.png" alt="context menu rendered by $.contextMenu">
<img src="screenshots/native.firefox-9.0a1.png" alt="Native context menu in Firefox 9.0 Alpha 1">
<!-- img src="screenshots/jquery-contextMenu.png" alt="context menu rendered by $.contextMenu" -->
The contextMenu Plugin was designed for web applications in need of menus on a possibly large amount of objects.
Unlike implementations as <a href="" target="_blank">a beautiful site's</a> or <a href="" target="_blank">trendskitchens'</a> this contextMenu treats the menu as the primary object. That means, that a single menu is defined that can be used by multiple objects. Unlike the mentioned plugins, contextMenu doesn't need to bind itself to triggering objects. This allows injecting and removing triggers without having to re-initialize or update contextMenu.
contextMenu can provide a simple list of clickable commands, or offer an in-menu form. This makes very simple attribute modification possible. See the <a href="demo.html#inputs">input example</a>.
Once a menu is registered, it cannot be altered. That means no commands can be added or removed from the menu. This allows contextMenu to keep a single definition in memory, which enables it to work with hundreds of trigger objects. contextMenu knows the two callbacks <em>show</em> and <em>hide</em> which can be used to update the state of commands within the menu. This allows en/disabling commands, changing icons or updating the values of contained &lt;input&gt; elements.
And, yes, the icons provided in this demo are taken from a <a href="">beautiful site</a>,
as well as some implementation ideas...
<h2 id="features">Features</h2>
<li>trigger contextMenu with right-click, left-click, hover or own custom trigger events</li>
<li>delegated event handling removing the need for re-initialization when trigger objects are added / removed</li>
<li>optional icons for commands</li>
<li>input elements (text, textarea, checkbox, radio, select) within the menu</li>
<li>custom html elements (command free)</li>
<li>show/hide callbacks to update the state of commands</li>
<li>small memory footprint even with hundreds of trigger objects</li>
<li>adjust position of menu to fit in viewport</li>
<li>enable / disable commands</li>
<li>nested sub-menus</menu>
<li>full keyboard interaction</menu>
<li>HTML5 &lt;menu&gt; support</menu>
<li>CSS is for styling, javascript is not...</li>
<h2 id="authors">Authors</h2>
<li><a href="">Rodney Rehm</a></li>
<li><a href="">Christian Baartse</a> (single callback per menu)</li>
<li><a href="">Addy Osmani</a> (compatibility with native context menu in Firefox 8)</li>
<h2 id="license">License</h2>
<p>$.contextMenu is published under the <a href="">MIT license</a>.</p>
Jump to Line
Something went wrong with that request. Please try again.