2
Contributors
2
Replies
3
Views
9 Years
Discussion Span
Last Post by essential
0

A quick example on how to disable right click for specific link!
Hope you had a great time! Enjoy...

<html>
<head>
<title>noRclick</title>
<script type="text/javascript">
<!--
document.onclick = function( e )
{ e = e ? e : window.event;
  t = e.target ? e.target : e.srcElement;
if (( t.name ) && ( t.name == 'link1' ) && ( e.which == 2 ) || ( e.which == 3 )) { alert('\nSorry right click has been disabled for this link!'); return false; } 
else 
{ 
return true; 
 } 
}
//-->
</script>
</head>
<body>
<a name="link1" href="#"> Link One</a><br />
<a name="link2" href="#">Link Two</a>
</body>
</html>
This topic has been dead for over six months. Start a new discussion instead.
Have something to contribute to this discussion? Please be thoughtful, detailed and courteous, and be sure to adhere to our posting rules.