Displaying through an iframe.

3 years 6 months ago #123098 by MichaelLuciuk
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">

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"; }

<iframe id="form-iframe" class="col-xs-12" src="'.$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.

3 years 6 months ago #123134 by tpartner
This isn't really a LimeSurvey issue but a quick Google... stackoverflow.com/questions/9162933/make...de-jquery-javascript

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!