jQuery-contextMenu
jQuery-contextMenu copied to clipboard
html5 & callback is not actually working
The callback in code below is not actually working. What to do in case of html5 menu?
$.contextMenu({
selector: '.context-menu-one',
callback: function(key, options) {
var m = "global: " + key;
console.log("callback");
window.console && console.log(m) || alert(m);
},
items: $.contextMenu.fromMenu($('#html5menu'))
});
HTML:
<p><span class="context-menu-one">right click me</span></p>
<menu id="html5menu" type="context" style="display:none">
<command label="rotate" onclick="alert('rotate')" icon="images/cut.png">
<command label="resize" onclick="alert('resize')" icon="images/door.png">
<menu label="share">
<command label="twitter" onclick="alert('twitter')" icon="images/page_white_copy.png">
<hr>
<command label="facebook" onclick="alert('facebook')" icon="images/page_white_edit.png">
<hr>
<label>foo bar<input type="text" name="foo"></label>
</menu>
</menu>
I'm sorry but currently there is no support for a custom callback when building the menu from a HTML5 menu element.