2017-02-09 78 views
0

如何在使用引導網格時增長iframe以匹配其高度?據我所知,iframe具有固定的高度,但是當我使用網格調整列時,它不會調整大小。因此使用其他解決方案來設置加載高度不起作用。使用自舉網格調整大小的自動iframe

<div class="container-fluid"> 

    <div class="row"> 
     <div class="col-md-12"> 
      <div> 
       <DIV> 
        <DIV> 
         <IFRAME XXXstyle="min-height: 100%; width:100%" xstyle="BORDER-TOP: 0px; HEIGHT: 100%; BORDER-RIGHT: 0px; WIDTH: 100%; BORDER-BOTTOM: 0px; BORDER-LEFT: 0px" 
          frameBorder=0 
          scrolling=no src="footer.html"> 
         </IFRAME> 
        </DIV> 
       </DIV> 
      </div> 
     </div> 
    </div> 
</div> 

對於footer.html我:

<div class="container-fluid"> 
    <div class="row"> 
     <div class="col-md-2 col-md-offset-1"> 
     </div> 
     <div class="col-md-2 "> 
     </div> 
     <div class="col-md-2 "> 
     </div> 
     <div class="col-md-2 "> 
     </div> 
     <div class="col-md-2 "> 
     </div> 
    </div> 
</div> 

感謝。

回答

0

我知道它是這樣工作的,再加上在body onload事件中調用它。

我不知道如何與這雖然給jqueryfy身體onload事件......

$(window).resize(function() { 
    resizeFrame(document.getElementById('footerIFRAME')) 
}); 

function resizeFrame(f) { 
    f.style.height = f.contentWindow.document.body.scrollHeight + "px"; 
}