you can disable the menu
$(document).bind("contextmenu", function(e) {
return false;
});
you can show a div
$(document).bind("contextmenu", function(e) {
$('#menu').css({
top: e.pageY+'px',
left: e.pageX+'px'
}).show();
return false;
});
but is it possible only to add an entry to the rightclick contextmenu?
Thanks in advance!
Peter
Not in JavaScript no...this could have some pretty malicious uses.
You can create your own menu (like your <div>
example), but not add items to the native browser context menu.
Thanks to HTML5 this is possible now: http://davidwalsh.name/demo/html5-context-menu.php
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With