试图调整iframe的大小

时间:2013-01-02 17:51:23

标签: jquery iframe resizable

好的,我从这里尝试了两个解决方案(论坛到目前为止没有发生任何事情)这里是我的代码:

<script>
<!---tried this without success-->
$("#mySupport").resizable();
alert("Hello! I am an alert box!!");
<!--also tried this from the forums-->
$(document).ready(function(){
    $('#mySupport', window.parent.document).height($(document).height());
});

</script>
<iframe id="mySupport" width="960" height="900" seamless src="https://enterraglobal.zendesk.com/"  scrolling="no">



</iframe>
<!--I don't know probably I'm missing something-->

2 个答案:

答案 0 :(得分:0)

$(document).ready(function(){
    $("#mySupport").height("100px");
});

答案 1 :(得分:0)

我认为您正在尝试将iframe设置为与外部文档相同的大小。如果是这样的话:

$(document).ready(function()
{
    $('#mySupport').height( $(document).height() ); 
    $('#mySupport').width( $(document).width() ); 
});

jsfiddle