How do I close a jquery contextMenu? -


i'm using a jquery contextmenu plug-in , have small issue i'm trying resolve.

currently when click 'delete' menu item function call prompts user confirmation box deletetests function. @ point contextmenu still visible , confirmation box.

ideally close contextmenu user selects menu item , proceed delete function.

this seems should trivial can't seem working.

$(document).ready(function(){     $.contextmenu({selector: '#context-menu', items: {     "delete": {name: "delete", icon: "delete", callback: menu_click },     sep1: "---------",     quit: {name: "quit", icon: "quit", callback: $.noop} }});  function menu_click(key, opt) {     if (key == "delete") {     // need close menu here         deletetests();     } } }); 

you're right. should trivial, author did not provide functionality.

you can @ source , copy whatever author did when clicks outside of menu detected, hack.


you're in luck; i've done same thing plug-in myself.

the following do, remember it's hack:

$('.contextmenu').hide(); 

Comments

Popular posts from this blog

linux - Using a Cron Job to check if my mod_wsgi / apache server is running and restart -

actionscript 3 - TweenLite does not work with object -

jQuery Ajax Render Fragments OR Whole Page -