Javascript: 100% Height em Iframes

Calendário de artigos

< Junho 2007 >
S T Q Q S S D
voltar ao mês actual
A carregar
        01 02 03
04 05 06 07 08 09 10
11 12 13 14 15 16 17
18 19 20 21 22 23 24
25 26 27 28 29 30  
Será que alguém me consegue ajudar? Precisava de expandir um iframe em 100% de altura no browser (já que em comprimento ele dá). Funciona no Opera, mas nos outros browsers não (Firefox, Ie6, Ie7, Safari). Este foi o código que descobri pela net: No head:
< script type="text/javascript"> function autofitIframe(id) { if (!window.opera && !document.mimeType && document.all && document.getElementById) { parent.document.getElementById(id).style.height=this.document.body.offsetHeight+"px"; } else if(document.getElementById) { parent.document.getElementById(id).style.height=this.document.body.scrollHeight+"px" } } </script>
No body
<body id="home" onload="autofitIframe(main)"></div>
No iframe:
<iframe src="index.php" width="100%" height="692" name="main" scrolling="no" frameborder="0" onload="autofitIframe(NULL, 'main')" style="margin: 0; padding: 0;"></iframe>
Editado: bom... troquei por frames

Comentários