0

I want to implement some manual functionality on right click on browser. How can I achieve that? Is there any plugin avail or any supporting js file available for that?

jww
  • 97,681
  • 90
  • 411
  • 885
Pratik Joshi
  • 248
  • 2
  • 6
  • 23
  • I removed the Java tag since it is not the way to go about this (fortunately). BTW - why do you want to mess with the user's right click button? That always p*sses me off, and I close that site and black-list it, even if the intent was honorable (which it usually **isn't**). – Andrew Thompson Jan 17 '14 at 11:03

2 Answers2

1

You can use:

window.oncontextmenu = function ()
{
//code here
 return false;     // cancel default menu
}
Milind Anantwar
  • 81,290
  • 25
  • 94
  • 125
1

using jQuery something like

<div id="clickme">click</div>

$('#clickme').mousedown(function(event) {
    if(event.which==3) {
        alert('Right mouse button pressed');
    }
});

Fiddle

Steven
  • 1,444
  • 17
  • 23