Ver Mensaje Individual
  #2 (permalink)  
Antiguo 28/02/2007, 02:08
Avatar de JavierB
JavierB
Colaborador
 
Fecha de Ingreso: febrero-2002
Ubicación: Madrid
Mensajes: 25.052
Antigüedad: 23 años, 1 mes
Puntos: 772
Re: Expandir area de contenido en JavaScript.

Hola Haggen

Prueba este ejemplo:
Código PHP:
<html>
<
head>
<
style type="text/css">
div {border:1px solid black}
#algo {height:0; overflow: hidden; display:none}
</style>
<
script type="text/javascript">
var 
h=0;
var 
pepe;
function 
expandir(ide) {
  
obj=document.getElementById(ide);
  
obj.style.display='block'
  
for (i=0i<50i++)
  
capa=ide;
  
pepe=setInterval('agranda(capa)',10);
}
function 
agranda(obj) {
  
obj=document.getElementById(obj);
  
h++;
  if (
h>50clearInterval(pepe);
  
obj.style.height h+'px';
}
</script>
</head>
<body>
<div><a href="#" onclick="expandir('algo'); return false">Ver</a></div>
<div id="algo">
Nombre: Pepe<br>
Apellido: Potamo;
</div>
</body>
</html> 
Saludos,