5

How do I use http://jqueryui.com/menu/ as a context menu on right mouse click. Is there a plugin or something?

jquery-1.9.0 jquery-ui-1.10.0

mar10
  • 14,320
  • 5
  • 39
  • 64
user007
  • 1,064
  • 3
  • 12
  • 29

3 Answers3

6

Here I started a plugin for this purpose: jquery-ui-contextmenu (supports delegation and creating menu definitions from JS objects).

mar10
  • 14,320
  • 5
  • 39
  • 64
  • FYI I added ".css('z-index','9999')" in the create function. This makes the plugin perfect for use with jquery fullcalendar :) – jeremyj11 Oct 04 '13 at 08:36
4

Here's a solution quickly hacked together from the jquery ui sample page: jsBin

  • Thx it works but now I have the problem with hide() on left mouse click $(document).click(function (e) {$("#menu").hide();}); After hidding and clicking again menu possision is bad. maybe you know how to fix it? – user007 Jan 28 '13 at 17:15
  • 1
    Found the fix: $(document).click(function (e) { $("#menu").hide(); $("#menu").css("top", ""); $("#menu").css("left", ""); }); – user007 Jan 28 '13 at 17:28
0

You can use a plugin I wrote called Audero Context Menu.

Aurelio De Rosa
  • 21,856
  • 8
  • 48
  • 71