CodePlexProject Hosting for Open Source Software
//****************************************************************************** // Module : rightClick.js //****************************************************************************** // DISCLAIMER: This Application is provide on AS IS basis without any warranty //****************************************************************************** var BM = 2; // button middle var BR = 3; // button right var msg ="MOUSE RIGHT CLICK IS NOT SUPPORTED ON THIS PAGE"; function mouseDown(e) { try { if (event.button==BM||event.button==BR) {return false;} } catch (e) { if (e.which == BR) {return false;} } } document.oncontextmenu = function() { alert(msg); return false; } document.onmousedown = mouseDown; //******************************************************************************
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"> <html xmlns="http://www.w3.org/1999/xhtml"> <head runat="server"> <title>NO RIGHT CLICK | DEMO</title> <script src="rightClick.js" type="text/javascript"></script> </head> <body> <form id="form1" runat="server"> <div> MOUSE RIGHT CLICK EVENT IS NOT SUPPORTED (TRY IT)... </div> </form> </body> </html>
Last edited Aug 28, 2010 at 3:03 PM by DrABELL, version 7