Nu sunteti conectat. Conectati-va sau inregistrati-va

Script anti click dreapta

In jos  Mesaj [Pagina 1 din 1]

1 Script anti click dreapta la data de Vin Aug 13, 2010 3:44 am

Vizitato


Vizitator
Cu acest script nu puteti da click dreapta pe imagini...

Cod:
<script language="Javascript1.2">


var clickmessage="Right click disabled on images!"

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>

2 Re: Script anti click dreapta la data de Vin Aug 13, 2010 3:48 am

DELETE


Banned
Banned
script anti selectare text:

Cod:
<script type="text/javascript">


function disableSelection(target){
if (typeof target.onselectstart!="undefined") //IE route
  target.onselectstart=function(){return false}
else if (typeof target.style.MozUserSelect!="undefined") //Firefox route
  target.style.MozUserSelect="none"
else //All other route (ie: Opera)
  target.onmousedown=function(){return false}
target.style.cursor = "default"
}

//Sample usages
//disableSelection(document.body) //Disable text selection on entire body
//disableSelection(document.getElementById("mydiv")) //Disable text selection on element with id="mydiv"

</script>



Script anti selectare text(doar pentru opera):

Cod:
<script language="Javascript" type="text/javascript">
<!--
function NoRightClick(e)
{
  if(navigator.appName=="Netscape")
  {
      if(e.which==3||e.which==2)
      {
        return false;
      }
  }
  else
  {
      event.cancelBubble=true;
      event.returnValue=false;
  }
}

if(navigator.appName=="Netscape")
  window.captureEvents(Event.MOUSEDOWN)
document.oncontextmenu=NoRightClick;
window.onmousedown=NoRightClick;
// -->
</script>

Vezi profilul utilizatorului

Sus  Mesaj [Pagina 1 din 1]

Permisiunile acestui forum:
Nu puteti raspunde la subiectele acestui forum