Skip to content

davidboyle/jQuery-contextMenu

 
 

Repository files navigation

jQuery contextMenu Plugin

$.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

Dependencies

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

Usage

register contextMenu from javascript:


$.contextMenu({
	// 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>:


$.contextMenu("html5");

Minify

use Google Closure Compiler:


// ==ClosureCompiler==
// @compilation_level SIMPLE_OPTIMIZATIONS
// @output_file_name contextMenu.js
// @code_url http://medialize.github.com/jQuery-contextMenu/jquery-1.6.1.min.js
// @code_url http://medialize.github.com/jQuery-contextMenu/jquery.ui.position.js
// @code_url http://medialize.github.com/jQuery-contextMenu/jquery.contextMenu.js
// ==/ClosureCompiler==	

License

$.contextMenu is published under the MIT license.

About

contextMenu manager

Resources

Stars

Watchers

Forks

Packages

 
 
 

Contributors