Ver Mensaje Individual
  #1 (permalink)  
Antiguo 16/12/2008, 14:58
bauhaus1975
 
Fecha de Ingreso: agosto-2003
Ubicación: Málaga, España
Mensajes: 419
Antigüedad: 21 años, 8 meses
Puntos: 1
De acuerdo Alargar columnas dinamicamente

Hola a todos.
Se trata de un script para poder igualar la altura de columnas laterales al centro. Algo que muchos habréis visto a estas alturas. El caso es que no funciona en Fire Fox si la cabecera es la siguiente (en cambio para HTML sí funciona)

Código HTML:
<!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"> 
Y este es el famoso script, el cual creo que puso alguien por aquí hace tiempo:

Código HTML:
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<html> 
<head> 
    <title>Alargar columnas</title> 
    <script language="javascript" type="text/javascript"> 
        function meterMasContenido() 
        { 
            var capaCentral = document.getElementById("container"); 
            var TDInformacion = capaCentral.getElementsByTagName("td")[0]; 
            TDInformacion.innerHTML += "jfaldsjflakdjflkadsj flkasjd flkñdsj alkñfjasdlk fjaslkñd jfñaldsj fñlkaj fñlksjf ñklajdf ñlkjfñlksdajf ks fklsajd fkjsadlk jfsadlkf jñadsjf ñlaksj fads<br><br>fdsajf ldsajflkdjg lkfdj glkfdsj glsdkfj gñlfdsjg ñlfsj gñlkdfjg ñlkfjg ñldsj ñgldñg lfgjreoitgj rtoihjofgij fghjoi fgj oifgjh oifjh oifdjh oipfhj o<br><br>vmf gjfdsg ifdsj giosfdj goisfj goisdfjg oisf jg"; 
            alargar(); 
        } 
        function alargar() 
        { 
            // redimensionamos los laterales y ponemos el tamaño de la capa de la información 
            document.getElementById("izquierda").style.height = document.getElementById("centro").clientHeight; 
            document.getElementById("derecha").style.height = document.getElementById("centro").clientHeight; 
        } 
    </script> 
</head> 
<body onLoad="javascript:alargar();"> 
<div id="container" style="position:relative;display:inline;float:left;width:100%;height:500px;border:1px solid red"> 
    <div id="izquierda" style="position:relative;display:inline;float:left;width:300px;height:100%;background-color:red"></div> 
    <div id="centro" style="position:relative;display:inline;float:left;width:600px;background-color:blue"> 
        <table cellpadding="0" cellspacing="0" width="100%" style="height:100%" border="0"> 
            <tr> 
                <td><input type="Button" value="Meter mas contenido" onclick="meterMasContenido()"></td> 
            </tr> 
        </table> 
    </div> 
    <div id="derecha" style="position:relative;display:inline;float:left;width:300px;height:100%;background-color:green"></div> 
</div> 
</body> 
</html> 
¿Alguien tiene alguna idea de cómo solucionarlo o tiene otro script que funcione en cualquier navegador?
Muchas gracias y un saludo.