Hi, i'm trying to display my survey through an iframe onto another site. I want the iframe to re-size every time the user goes to a new page on the survey becuase not all my pages are the same length. Currently I have this in the html in my template right after the outer frame div closes on all the pages (I gave the outer frame an id of Outer_frame).
<script type="text/javascript">
parent.AdjustIframeHeight(document.getElementById("Outer_frame").scrollHeight);
</script>
In the PHP code for my page I have the following form element.
$form = array(
'#prefix' => '<div>',
'#suffix' => '</div>',
'#markup' =>
'<script type="text/javascript">
function AdjustIframeHeightOnLoad() { document.getElementById("form-iframe").style.height = document.getElementById("Outer_frame").contentWindow.document.body.scrollHeight + "px"; }
function AdjustIframeHeight(i) { document.getElementById("form-iframe").style.height = parseInt(i) + "px"; }
</script>
<iframe id="form-iframe" class="col-xs-12" src="
52.10.69.156/limesurvey/index.php/survey...83X27X291='.$account
.'"
width="100%" scrolling="no" onload="AdjustIframeHeightOnLoad()" frameborder="0" position="absolute" align="left" style="height: 1750px"margin-top: 0px; margin-left:-15px; margin-right:20px; overflow:hidden; float:left;">
Your browser does not support iframes.</iframe>'
);
Anyway it is not re sizing
Please help!