Ver Mensaje Individual
  #3 (permalink)  
Antiguo 10/02/2011, 04:17
Whaith
 
Fecha de Ingreso: febrero-2011
Ubicación: Madrid
Mensajes: 9
Antigüedad: 13 años, 2 meses
Puntos: 1
Respuesta: Auto ajustar tamaño de iframe

Buenas insyse,

Metele este codigo en el <head> y me cuentas.

Código HTML:
<script language="JavaScript"> 
          <!--
          function calcHeight()
          {
        //find the height of the internal page
        var the_height=
        document.getElementById('resize').contentWindow.
        document.body.scrollHeight;
        
        //change the height of the iframe
        document.getElementById('resize').height=
        the_height;
        }
        //-->
</script> 
Acuerdate de llamar a la funcion en el iframe... metele este atributo

onLoad="calcHeight();"

Deberia quedarte algo así:

Código HTML:
<iframe src="proyecto educativo.html" name="iframe" width="100%" height="100%" align="center" scrolling="auto" frameborder="0" id="iframes" allowtransparency="true" border="0" onLoad="calcHeight();"></iframe>