Hi friends,

After working hard to complete your  design and images  ,some persons just save that images and web pages.

This is one  idea to disable the right click on webpage.

just put a small javascript code at the place between the head section.

*************************

<SCRIPT LANGUAGE=”JavaScript”>
<!– Disable
function disableselect(e){
return false
}

function reEnable(){
return true
}

//if IE4+
document.onselectstart=new Function (“return false”)
document.oncontextmenu=new Function (“return false”)
//if NS6
if (window.sidebar){
document.onmousedown=disableselect
document.onclick=reEnable
}
//–>
</script>

*****************************

Demo at @ http://labs.anillabs.com/disable-rightclick.php

Categories: JavaScript

4 Comments

srinivas tamada · February 26, 2010 at 5:40 am

Nice tip anil.. Are you interested to write an artilce on my blog..

Just togeather all your old post. Sure your blog traffic increase through my blog

Sumeet · June 17, 2010 at 12:43 pm

Thanx champ, Thanx a lot for all your good work. Keep Posting.

Pradnya · June 8, 2017 at 9:33 am

Good, but to inspect the page we can use ctrl+shift+i also. Is there any solution to disable this also?

Leave a Reply

Avatar placeholder

Your email address will not be published. Required fields are marked *