0

我有一个包含多个 iframe 的网页。这些 ifrmaes 试图加载一些 Web 表单。我的问题是,这些表单没有在 Firefox 中加载,但在 IE8 和 chrome 中运行良好。

有什么想法可以解决这个问题吗?

以下是代码片段。它的作用是动态创建多个 iframe。

foreach ($references as $key => $reference) {
  <iframe scrolling='no' onload='javascript:resizeIframe(this);' id="refForm_<?php echo $reference->getRecruitmentReferenceFormData()->getId(); ?>" style="display:block;margin-left:auto;margin-right:auto;" src="<?php echo url_for('recruitment/viewReferenceForm') . '?id=' . $reference->getRecruitmentReferenceFormData()->getId(); ?>" id="rightMenu" name="rightMenu" height="1000px" frameborder="0"></iframe>
  <?php
}

function resizeIframe (obj) {
    var size = obj.contentWindow.document.body.offsetHeight;
    size = size + 900;

    obj.style.height = obj.contentWindow.document.body.offsetHeight + 'px';
    obj.style.height = obj.contentWindow.document.body.scrollHeight + 'px';
    obj.style.width = obj.contentWindow.document.body.scrollWidth + 'px';  
}
4

0 回答 0