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

c++ - Delete matches in OpenCV (Keypoints and descriptors) -

java - Could not locate OpenAL library -

sorting - opencl Bitonic sort with 64 bits keys -