I my web application I want to Hide/ Remove some for the menus like View Source, Properties using JavaScript coding. This should available in entire webpage.
Asked
Active
Viewed 148 times
0
-
I don't want to hide complete right click menu, I just want to hide some of the property – vinoth Dec 06 '11 at 08:37
2 Answers
1
Do not do it.
You only make your users angry but you can not stop them any way.
See also How do I disable right click on my web page?
If I can't stop you from doing it. You can only disable the whole menu:
<script language="javascript">
document.onmousedown=disableclick;
Function disableclick(e)
{
if(event.button==2)
{
return false;
}
}
</script>

Community
- 1
- 1

PiTheNumber
- 22,828
- 17
- 107
- 180
0
var message="Sorry, right-click has been disabled";
function clickIE() {if (document.all) {(message);return false;}}
function clickNS(e) {
if(document.layers||(document.getElementById&&!document.all)) {
if (e.which==2||e.which==3) {(message);return false;}}}
if (document.layers){
document.captureEvents(Event.MOUSEDOWN);
document.onmousedown=clickNS;
}
else{
document.onmouseup=clickNS;
document.oncontextmenu=clickIE;
}
document.oncontextmenu=new Function("return false")
This is code disable the right click.

Sameera Thilakasiri
- 9,452
- 10
- 51
- 86