2012-11-20 44 views
-2

我需要使用Javascript來根據瀏覽器中的可用高度動態修復iframe高度?JavaScript根據瀏覽器窗口中的可用高度來修復iframe高度

+0

我試圖函數縮放器(){ VAR _if​​rame =的document.getElementById( 'frmContent'); var _divIframe = document.getElementById('iframe'); _iframe.height = window.innerHeight - 135; _iframe.width = window.innerWidth - 10; } – Shan

+0

但這是工作在鉻,IE 9不在IE 8中。 – Shan

+0

有沒有這個窗口高度 – Shan

回答

0

這是你在找什麼?

$(function(){  
    //sets the height of the iframe to the height of the browser viewport 
    $("#idOfIframe").height($(window).height()); 
} 
相關問題