Displaying through an iframe.

More
3 years 3 months ago #123098 by MichaelLuciuk
MichaelLuciuk created the topic: Displaying through an iframe.
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!

Please Log in or Create an account to join the conversation.

More
3 years 3 months ago #123134 by tpartner
tpartner replied the topic: Displaying through an iframe.
This isn't really a LimeSurvey issue but a quick Google... stackoverflow.com/questions/9162933/make...de-jquery-javascript

Cheers,
Tony Partner
Solutions, code and workarounds presented in these forums are given without any warranty, implied or otherwise.

Please Log in or Create an account to join the conversation.

Start now!

Just create your account and start using Limesurvey today.

Register now
Join our Newsletter!