javascript - Jquery contextmenu event always returns e.which as 0 -


i using contextmenu bound using jquery on. , noticed e.which , e.button 0.

is there reason this?

$("div").on("contextmenu", function(e){   if(e.which) //always 0     //do }); 

edit: mistake happens in ie8, missed specify browser version.

you should go mousedown event works on ie8

$("div").on("mousedown", function(e){     alert(e.which);     if(e.which == 3){         //do     } }); 

demo


Comments

Popular posts from this blog

node.js - How to mock a third-party api calls in the backend -

java - Could not locate OpenAL library -

Non Unique Username with ASP.Net Identity 2.0 -