Posts context menu
Post
Cancel

context menu

https://github.com/sydcanem/bootstrap-contextmenu

https://github.com/callmenick/Custom-Context-Menu


supports dynamic elements

https://github.com/swisnl/jQuery-contextMenu

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
//http://swisnl.github.io/jQuery-contextMenu/demo/dynamic-create.html

$(function(){}

 $.contextMenu({
		selector: 'a', 
		build: function($trigger, e) {
		console.log($trigger.attr('href'));
		// this callback is executed every time the menu is to be shown
		// its results are destroyed every time the menu is hidden
		// e is the original contextmenu event, containing e.pageX and e.pageY (amongst other data)
			return {
				callback: function(key, options) {
					var m = "clicked: " + key;
					window.console && console.log(m) || alert(m); 
				},
				items: {
					"edit": {name: "Edit", icon: "edit"},
					"cut": {name: "Cut", icon: "cut"},
					"copy": {name: "Copy", icon: "copy"},
					"paste": {name: "Paste", icon: "paste"},
					"delete": {name: "Delete", icon: "delete"},
					"sep1": "---------",
					"quit": {name: "Quit", icon: function($element, key, item){ return 'context-menu-icon context-menu-icon-quit'; }}
				}
			};
		}
	});

});

2012 - 5 jQuery Right Click Context Menu Plugins

http://www.sitepoint.com/right-click-context-menu-plugins/

origin - http://www.pipiscrew.com/?p=4586 js-context-menu

This post is licensed under CC BY 4.0 by the author.
Contents

Trending Tags