pelatink چاڤدێر-المشرف
المزاج : الهواية : المهنة : الدولة : عدد المساهمات : 40 نقاط : 5632 تاريخ التسجيل : 20/09/2009 العمر : 35 الموقع : دهوك
| موضوع: كود منع أستخدام الزر الأيمن الأحد يناير 10, 2010 5:13 am | |
| كثيرا ما نجد صور موقعنا مسروقة.. او لا نحب ان تنسخ هذا صورة في مواقعنا لذا هذا السكريبت يجمد ائ (بلوك رايت كليك) يمكنك من خلال ائ كود أدناء منع ذلك - الكود:
-
<script language=Javascript1.2> function ejs_nodroit() { alert('ممنوع أستخدام الزر الايمن'); return(false); } document.oncontextmenu = ejs_nodroit; </script> كود ثاني بدون نافيذ - الكود:
-
<script language="Javascript1.2"> function disableselect(e){ return false }
function reEnable(){ return true }
//if IE4+ document.onselectstart=new Function ("return false")
//if NS6 if (window.sidebar){ document.onmousedown=disableselect document.onclick=reEnable } </script> كود جميل يمنع الزر الأيمن على صور فقط والباقي حر - الكود:
-
<script> /* Disable right click script II (on images)- By Dynamicdrive.com For full source, Terms of service, and 100s DTHML scripts Visit [url=http://www.dynamicdrive.com]http://www.dynamicdrive.com[/url] */ var clickmessage="Right click disabled no way !" function disableclick(e) { if (document.all) { if (event.button==2||event.button==3) { if (event.srcElement.tagName=="IMG"){ alert(clickmessage); return false; } } } else if (document.layers) { if (e.which == 3) { alert(clickmessage); return false; } } else if (document.getElementById){ if (e.which==3&&e.target.tagName=="IMG"){ alert(clickmessage) return false } } } function associateimages(){ for(i=0;i<document.images.length;i++) document.images[i].onmousedown=disableclick; } if (document.all) document.onmousedown=disableclick else if (document.getElementById) document.onmouseup=disableclick else if (document.layers) associateimages() </script> | |
|