Ver Mensaje Individual
  #9 (permalink)  
Antiguo 05/05/2007, 04:59
Avatar de caricatos
caricatos
Moderador
 
Fecha de Ingreso: abril-2002
Ubicación: Torremolinos (Málaga)
Mensajes: 19.607
Antigüedad: 21 años, 11 meses
Puntos: 1284
Re: IFRAME que se ajuste en altura

Hola:

Había algún tema sobre esta cuestión, adaptando el tamaño del iframe al offsetWidth del body de la página:

Código:
<html>
<head>
<title>
iframe adaptable
</title>
<script type="text/javascript">
function ini() {
 document.getElementById("prueba").width = window.frames.prueba.document.body.offsetWidth + window.frames.prueba.document.body.scrollWidth;
 document.getElementById("prueba").height = window.frames.prueba.document.body.offsetHeight + window.frames.prueba.document.body.scrollHeight;
}
</script>
</head>
<body>
<iframe id="prueba" name="prueba" src="index.html" onload="ini()"></iframe>
</body>
</html>
Pero las páginas del iframe deben ser del mismo dominio.

Saludos
__________________
Por favor:
No hagan preguntas de temas de foros en mensajes privados... no las respondo