Warning: file_get_contents(/data/phpspider/zhask/data//catemap/9/javascript/435.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
Javascript iframe更改高度时调整容器大小_Javascript_Jquery_Twitter Bootstrap_Iframe - Fatal编程技术网

Javascript iframe更改高度时调整容器大小

Javascript iframe更改高度时调整容器大小,javascript,jquery,twitter-bootstrap,iframe,Javascript,Jquery,Twitter Bootstrap,Iframe,我试图找到一种方法,当其中包含的iFrame改变高度时,调整嵌入div的大小 这基本上就是我所拥有的: 试试这个 函数setContentHeight(){ var iframe=$('#contentIframe').contents(); if(iframe){ var height=iframe.height(); $(“iframeContainer”)。高度(height); } }

我试图找到一种方法,当其中包含的iFrame改变高度时,调整嵌入div的大小

这基本上就是我所拥有的:


试试这个


函数setContentHeight(){
var iframe=$('#contentIframe').contents();
if(iframe){
var height=iframe.height();
$(“iframeContainer”)。高度(height);
}   
}