Kód:
<script language="JavaScript">
<!--
function autoResize(id){
var newheight;
var newwidth;
if(document.getElementById){
newheight=document.getElementById(id).contentWindow.document .body.scrollHeight;
newwidth=document.getElementById(id).contentWindow.document .body.scrollWidth;
}
document.getElementById(id).height= (newheight) + "px";
document.getElementById(id).width= (newwidth) + "px";
}
//-->
</script>
Kód:
<IFRAME onmouseover="autoResize('iframe1')" SRC="formular/formular.html" width="100%" height="200px" id="iframe1" marginheight="0" frameborder="0"></iframe>
Ide o to, ze ked vyplnam formular jeho velkost sa meni a teda chcem aby sa menil aj iframe napriklad pri kliknuti mysi ale to nefunguje, ide iba onload a tusim onmouseover.
Nasiel som aj ine scripty, dlhsie, komplikovanejsie, ale ani jeden nefunguje.