/ Published in: JavaScript
I know what you think - no discussion about this needless piece of code to prevent copying texts/images from websites, but there are customers outside that are advising resistant and so I use this code to scare off their potential clienteles.
Expand |
Embed | Plain Text
Copy this code and paste it in your HTML
// this needs mootools framework and disable rightclick or better the contextmenu document.addEvent('contextmenu',function(e){ e=new Event(e); //alert('success'); e.stop(); }); function selectnone() { document.body.ondrag = function () { return false; }; document.body.onselectstart = function () { return false; }; if(window.ie || window.opera){document.body.setProperty("unselectable","on");} if(window.gecko){document.body.setStyle("MozUserSelect","none");} if(window.webkit){document.body.setStyle("KhtmlUserSelect","none");} } // call selectnone() onload/domready