Que tal, tengo una duda y consulta:
Como puedo redimensionar un iframe al tamaño del div padre que lo contiene?
Encontré este código que sirve para redimensionar segun el tamaño de la ventana
Código:
<script language="JavaScript">
<!--
function resize_iframe()
{
var height=window.innerWidth;//Firefox
if (document.body.clientHeight)
{
height=document.body.clientHeight;//IE
}
//resize the iframe according to the size of the
//window (all these should be on the same line)
document.getElementById("glu").style.height=parseInt(height-
document.getElementById("glu").offsetTop-8)+"px";
}
// this will resize the iframe every
// time you change the size of the window.
window.onresize=resize_iframe;
//Instead of using this you can use:
// <BODY onresize="resize_iframe()">
//-->
</script>
Y en el iframe:
Código:
<iframe id="glu" width="100%" onload="resize_iframe()"></iframe>
efectivamente lo hace, acá el ejemplo
Cita: guymal.com/mycode/100_iframe_example.shtml
pero yo necesito que se redimensione al tamaño del DIV padre. Cómo debo armarlo???
Gracias y saludos!