Ver Mensaje Individual
  #9 (permalink)  
Antiguo 27/01/2010, 16:50
vnz03
 
Fecha de Ingreso: febrero-2005
Mensajes: 3
Antigüedad: 19 años, 2 meses
Puntos: 0
Respuesta: iframe autoajustable

Hola,

Puedes probar este codigo en javascript, yo lo ocupe para .net c#


En el aspx donde está el un iframe agrego este tag

<script type="text/javascript" language="javascript">
function autofitIframe(id)
{
if (parent.document.getElementById(id) ==null)
{ return; }
if (!window.opera && !document.mimeType && document.all && document.getElementById){
parent.document.getElementById(id).style.height=th is.document.body.offsetHeight+"px";
}
else if(document.getElementById){
parent.document.getElementById(id).style.height=th is.document.body.scrollHeight+"px"
}
}

</script>

donde cargo todo el diseño de la página, agrego la propiedad de OnLoad

<body onload="autofitIframe('frmlink');">

y finalmente, mi iframe está así declarado

<iframe id="frmlink" name="frmlink" src="Inicio.aspx" width="95%" scrolling="no" runat="server"
marginheight="0" marginwidth="0" frameborder="0"></iframe>


Espero te sirva.

Saludos!