Add this attribute to the BODY Tag to disable the right click menu everywhere on the page.

<body oncontextmenu=”return false;”>

If you want disable dragging of images and text selection, add this attribute to the BODY Tag.

<body ondragstart =”return false;”>

Below this script is to disable right click menu and dragging of images and text selection for all browsers.

<script type=”text/javascript”>
function md(e) {
try { if (event.button == 2 || event.button == 3) return false; }
catch (e) { if (e.which == 3) return false; }
}
document.oncontextmenu = function () { return false; }
document.ondragstart = function () { return false; }
document.onmousedown = md;
</script>

Advertisements

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out /  Change )

Google+ photo

You are commenting using your Google+ account. Log Out /  Change )

Twitter picture

You are commenting using your Twitter account. Log Out /  Change )

Facebook photo

You are commenting using your Facebook account. Log Out /  Change )

w

Connecting to %s