Here's the fiddle that I threw together.
http://jsfiddle.net/uG2EE/
It's not perfect by any means, but it does what you want (uses jQuery UI, shows up near cursor when the context menu event is fired - or right click)
Unfortunately, I had to paste jQuery UI script into the script pane, so you need to scroll to the very bottom. Here's the JS I added to get this working:
$(function() {
// Set initial state (isVisible) then initialize menu
$("#menu").data('isVisible', false).menu();
// Initialize event handlers
$(document).on({
// Click is responsible for closing the menu, when it is visible
'click': function(e){
if(e.which === 1 && $('#menu').data('isVisible')){
$("#menu").css({
'display' : 'none'
}).data('isVisible', false);
}
},
// "onContextMenu" event is fired when user right clicks. We prevent the
// default by calling e.preventDefault(), and then display our jQuery-UI menu
'contextmenu': function(e){
var x = e.clientX,
y = e.clientY;
e.preventDefault();
// Check state (isVisible) to see if menu needs to be displayed
if($('#menu').data('isVisible') === false) {
$("#menu").css({
'display' : 'block',
'left' : x + 10,
'top' : y + 10
}).data('isVisible', true);
}
}
});
});
The CSS is very straight forward: display:none, position:absolute, and the width.
Good luck!