I have a canvas and I display an image inside it. I have attached a jquery event to it, like this:
$("#mycanvas").mousedown(function(e) {
//Do something
e.preventDefault();
e.stopPropagation();
});
I would expect this code to do my operations and to prevent default browser behavior. The former is fulfilled, however, the latter, namely, default behavior prevention does not happen. The event runs though. I wonder how could I prevent showing that menu you can see on the image upon right-click:
You can use contextmenu:
$("#mycanvas").contextmenu(function(e) {
//Do something
e.preventDefault();
e.stopPropagation();
});
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