I have a problem. With this html:
<div id="d"><div>Click me!</div><div>Or me</div></div>
When I use this code:
$("#d").on("mousedown", "div", function (e){
console.log('clicked');
if (e.which == 3) alert('left button clicked');
return false;
});
It prevents the context menu from showing and alerts, but when I use this code:
$("#d").on("mousedown", "div", function (e){
console.log('clicked');
if (e.which == 3) console.log('left button clicked');
return false;
});
It logs to the console, but doesn't prevent the context menu. I'm confused.
Here's a JSFiddle demonstrating the problem.
Oh, and please be patient if you happen to find a duplicate or something. I did try to find it.