Ver Mensaje Individual
  #254 (permalink)  
Antiguo 13/05/2007, 07:23
Avatar de nicolaspar
nicolaspar
 
Fecha de Ingreso: noviembre-2004
Ubicación: Villa Ballester Bs-As|Ar
Mensajes: 2.002
Antigüedad: 19 años, 5 meses
Puntos: 34
Re: FAQs JavaScript

Pregunta: Puedo eliminar la selección (encuadre) de los A?. Un ejemplo para explicar mejor el problema:

Código:
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1" />
<title>Documento sin t&iacute;tulo</title>

</head>

<body>
<a href="asa.hh">Test link</a>
</body>
</html>
Guarden esto, y verán que al hacer TAB con el teclado sobre el documento el links se marcan. Muy molesto cuando tenemos botoneras con imagenes, o imagenes mapeadas, también aplica a anclas que quedan marcadas al darles clic.


Respuesta
Código:
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1" />
<title>Un Focus by Nicolás Pardo</title>
<script>
function unFocusA() {
    anclas=document.getElementsByTagName("a").length;
    for (i=0;i<anclas;i++)
    document.getElementsByTagName("a").item(i).onfocus=new Function("if(this.blur)this.blur()")
}</script>
</head>

<body onload="unFocusA()">
<a href="asa.hh">Test link</a>
</body>
</html>
__________________
Mi punto de partida es Que Bueno Lo Nuevo