Ver Mensaje Individual
  #7 (permalink)  
Antiguo 10/06/2010, 23:42
Mokae
 
Fecha de Ingreso: marzo-2010
Ubicación: Culiacán, Sinaloa
Mensajes: 45
Antigüedad: 14 años, 1 mes
Puntos: 1
Respuesta: Ayuda Urgente! Script para prohibir clic derecho en Blog.

Tutorial. Disable Text Selection script / Deshabilitar la selección de texto script

ENG: Directions: Add this script to the HEAD section of your page:

ESP: Instrucciones: Añadir este script a la sección HEAD de su página:

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

/***********************************************
* Disable Text Selection script- © Dynamic Drive DHTML code library (www.dynamicdrive.com)
* This notice MUST stay intact for legal use
* Visit Dynamic Drive at http://www.dynamicdrive.com/ for full source code
***********************************************/

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>
ENG: With the script installed, just call the function disableSelection(target) at the very end of the document with a reference to the element you wish to disable text within. A few examples:

ESP: Con el script instalado, llame a la función disableSelection (objetivo) en el mismo final del documento con una referencia al elemento que desea desactivar el texto en su interior. Unos pocos ejemplos:

Cita:
<script type="text/javascript">
disableSelection(document.body) //disable text selection on entire body of page
</script>
Cita:
<script type="text/javascript">
var somediv=document.getElementById("mydiv")
disableSelection(somediv) //disable text selection within DIV with id="mydiv"
</script>
Cita:
<script type="text/javascript">
var alltables=document.getElementsByTagName("table")
for (var i=0; i<alltables.length; i++)
disableSelection(alltables[i]) //disable text selection within all tables on the page
</script>
ENG: Make sure to call the above functions at the end of the document to ensure the element in which to disable text for is defined before the function is called.

ESP: Asegúrese de llamar a las funciones anteriores al final del documento para garantizar el elemento en el que al texto se define para deshabilitar antes de la función es llamada.
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

Ya hice el primer paso pero los demás no le entiendo! Por favor ayuda!
__________________
Mi Blog personal Mi Facebook