javascript - How to prevent default right click on canvas containing image -
i have canvas , display image inside it. have attached jquery event it, this:
$("#mycanvas").mousedown(function(e) { //do e.preventdefault(); e.stoppropagation(); });
i expect code operations , prevent default browser behavior. former fulfilled, however, latter, namely, default behavior prevention not happen. event runs though. wonder how prevent showing menu can see on image upon right-click:
you can use contextmenu:
$("#mycanvas").contextmenu(function(e) { //do e.preventdefault(); e.stoppropagation(); });
Comments
Post a Comment