Ver Mensaje Individual
  #3 (permalink)  
Antiguo 25/06/2008, 09:07
FatalError
 
Fecha de Ingreso: junio-2008
Mensajes: 14
Antigüedad: 18 años, 3 meses
Puntos: 0
Respuesta: No me funciona hover en IE

Como te comentan IE6 no acepta el método "hover".

Hay una solución que he usado en alguna ocasión pero es un poco "marrana" y no me gusta nada:

Código PHP:

.table3 .odd {

     
background-color: #DDEEFF;
     
_iehack1: expression(this.onmouseover = new Function("_iehack=this.className;this.className+=' hover';"));
     
_iehack2: expression(this.onmouseout = new Function("this.className=_iehack;"));

.
table3 .even {

     
background-color: #EFF;
     
_iehack1: expression(this.onmouseover = new Function("_iehack=this.className;this.className+=' hover';"));
     
_iehack2: expression(this.onmouseout = new Function("this.className=_iehack;"));

}

.
table3 .even:hover,.table3 .odd:hover, .table3 .even.hover,.table3 .odd.hover{ background-color: #CFC;} 
Forzamos las expresiones .hover al estilo y las definimos como un estilo.

---------

Aunque lo mejor es que asignes estilos usando Javascript:

Asigna una id a las filas, por ejemplo "fieldOdd" y "fieldEven":

Dentro del head:

Código PHP:
<script language="javascript">
window.onload = iniTable;
</script> 
Enlaza a una libreria en Javascript que contenga:

Código PHP:
function styleOddHover (event) {
    
document.getElementById("fieldOdd").className = "oddHover";
}

function 
styleEvenHover (event) {
    
document.getElementById("fieldEven").className = "evenHover";
}

function 
styleOdd (event) {
    
document.getElementById("fieldOdd").className = "odd";
}

function 
styleEven (event) {
    
document.getElementById("fieldEven").className = "even";
}

function 
iniTable () {
    
document.getElementById("fieldOdd").onmouseover = styleOddHover;
    
document.getElementById("fieldEven").onmouseover = styleEvenHover;
    
document.getElementById("fieldOdd").onmouseout = styleOdd;
    
document.getElementById("fieldEven").onmouseout = styleEven;
} 
Añade el estilo:

Código PHP:
.table3 .evenHover, .table3 .oddHover{ background-color: #CFC;} 
Estoy escribiendo de memoria, así que puede haber fallos de escritura, si es así sorry pero es que estoy en el trabajo ;)