Ver Mensaje Individual
  #1 (permalink)  
Antiguo 04/06/2007, 04:24
Avatar de Adler
Adler
Colaborador
 
Fecha de Ingreso: diciembre-2006
Mensajes: 4.671
Antigüedad: 18 años, 2 meses
Puntos: 126
Switch en Firefox

Hola. este código funciona en IE pero en Firefox no. El problema es que se queda en el primer caso ("") y no pasa al segundo. Estoy seguro que el problema en FF es que no lee bien esta linea: switch (obj.style.background)

Código:
<html>
<head>
<script language="javascript" type="text/javascript">
function Cambio (obj) {

    switch (obj.style.background)
    {
        case "" :
            obj.style.background = "red";
            break;
        case "red" :
            obj.style.background = "yellow";
            break;
        case "yellow" :
            obj.style.background = "red";
            break;
    }
}
</script>
</head>
<body>
<table border="1">
<tr>
<td onmouseover="Cambio(this)" onmouseout="Cambio(this)">Texto</td>
</tr>
</table>
</body>
</html>
Gracias