Ver Mensaje Individual
  #7 (permalink)  
Antiguo 13/03/2013, 11:00
Avatar de djboro88
djboro88
 
Fecha de Ingreso: junio-2009
Ubicación: Valencia
Mensajes: 180
Antigüedad: 14 años, 10 meses
Puntos: 2
Respuesta: Dimensiones de DIV segun su contenido

Ya está solucionado, El alto del DIV, según su contenido y es más, el poder guardar el valor de la variable JS en una variable en PHP.

A quien le interese, aquí está el codigo:
Código PHP:
<!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>
<title>Pruebas</title>

</head>
<body>

<div id="div">
<?php //Calcular alto de DIV
    
for($i 0$i<=10$i++){
        echo 
$i."<br>";
    }
?>
</div>

<script language="javascript">
    var valor = document.getElementById('div').offsetHeight;
</script>

<?php $valor "<script> document.write(valor) </script>"?>

<br>

<b>VALOR: <?php echo $valor?></b>

</body>
</html>