C# Tutorials and offshore development in India
    Tutorials   Resources   Forum   Communities   Interview   Jobs   Projects   Offshore Development    
Silverlight Tutorials | Mentor | Code Converter | Articles | Code Factory | Computer Jokes | Members | Peer Appraisal | IT Companies | Bookmarks | Revenue Sharing |


Prizes & Awards
My Profile



Active Members
TodayLast 7 Days more...

New Feature: Community Sites: Create your own .NET community website and start earning from Google AdSense ! It's Free !




Disable Mouse Right Click using Javascript


Posted Date: 02 Sep 2008    Resource Type: Code Snippets    Category: Javascript

Posted By: Amalraj Irudayamani       Member Level: Silver
Rating:     Points: 10



The following javascript will disable the mouse right click event.


<script language="JavaScript">
var message="Right-mouse click is not allowed";
function click(e)
{
if (document.all)
{
if (event.button==2||event.button==3)
{
alert(message);
return false;
}
}
else
{
if (e.button==2||e.button==3)
{
e.preventDefault();
e.stopPropagation();
alert(message);
return false;
}
}
}
if (document.all) // for IE
{
document.onmousedown=click;
}
else // for other browsers
{
document.onclick=click;
}
</script>




Responses


No responses found. Be the first to respond and make money from revenue sharing program.

Feedbacks      
Popular Tags   What are tags ?   Search Tags  
Right click  .  Javascript  .  Html  .  Disable mouse click  .  

Post Feedback


This is a strictly moderated forum. Only approved messages will appear in the site. Please use 'Spell Check' in Google toolbar before you submit.
You must Sign In to post a response.
Next Resource: Automatic Reloading Page
Previous Resource: How to detect Browse Closed By Click on [X] Button
Return to Discussion Resource Index
Post New Resource
Category: Javascript


Post resources and earn money!
 
Related Resources



dotNet Slackers   BizTalk Adaptors    Web Design

audio conferencing services

Contact Us    Privacy Policy    Terms Of Use