Welcome to the LimeSurvey Community Forum

Ask the community, share ideas, and connect with other LimeSurvey users!

Displaying through an iframe.

  • MichaelLuciuk
  • MichaelLuciuk's Avatar Topic Author
  • Offline
  • New Member
  • New Member
More
9 years 3 months ago #123098 by MichaelLuciuk
Displaying through an iframe. was created 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">
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!
The topic has been locked.
  • tpartner
  • tpartner's Avatar
  • Offline
  • LimeSurvey Community Team
  • LimeSurvey Community Team
More
9 years 3 months ago #123134 by tpartner
Replied by tpartner on 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.
The topic has been locked.
Moderators: tpartnerholch

Lime-years ahead

Online-surveys for every purse and purpose