I need to use the function live on the document ready.
I tried this code (it does not work correctly):
$(document).live('ready', function() {
$(".icons").contextMenu(
{
menu: 'menuIcons'
},
function(action, el, pos)
{
contextMenuWork(action, el, pos);
});
function contextMenuWork(action, el, pos) {
switch (action) {
case "open":
{
alert("open");
break;
}
}
}
});
try this:
it uses late binding to bind to the event when the element is right clicked; it then re-triggers the right click event.