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
  • 90,984
  • 81
  • 374
  • 818
Pratik Joshi
  • 238
  • 1
  • 5
  • 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
  • 79,642
  • 23
  • 92
  • 120
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,394
  • 15
  • 20