在javascript,jQuery或css中,如何扩展div或iframe以填充其余空间

Ret*_*der 5 html javascript css xhtml jquery

我有三个iframe,我将顶部iframe设置为50px高度,我将底部iframe设置为50px,但我希望中间iframe能够填充余下的空间.是否有一种技术可用于任何窗口屏幕尺寸?谢谢.

例:

<iframe style="width:100%; height:50px;" src="headerstuff.asp" %></iframe>
<iframe style="width:100%; height:100%;" src="Content.asp" %></iframe>  <!-- height needs to fill -->
<iframe style="width:100%; height:50px;" src="footerstuff.asp" %></iframe>
Run Code Online (Sandbox Code Playgroud)

DrS*_*ove 2

<iframe id="i1" style="width:100%; height:50px;" src="headerstuff.asp" %></iframe>
<iframe id="i2" style="width:100%; height:100%;" src="Content.asp" %></iframe>  <!-- height needs to fill -->
<iframe id="i3" style="width:100%; height:50px;" src="footerstuff.asp" %></iframe>

var res, ires,n1,n2,h;
n1 = $('#i1').height(); 
n2 =$('#i3').height();
h= $(window).height();
ires = n1+n2;
res = h-ires;

$('#i2').height(res);
Run Code Online (Sandbox Code Playgroud)