我有六帧。当我点击中间框架上的按钮然后中间框架尺寸增加或减少时,我想要做。但问题是按钮标签在帧标签中不起作用。我想增加中间框架的宽度和高度。我怎么能这样做?
<!DOCTYPE HTML Frameset DTD>
<head>
<script src="http://localhost:55980/Scripts/jquery-3.1.0.min.js"></script>
<!--<script src="https://ajax.googleapis.com/ajax/libs/jquery/1.12.4/jquery.min.js">
function getFrameSize(frameID) {
var result = {height:0, width:0};
if (document.getElementById) {
var frame = parent.document.getElementById(frameID);
if (frame.scrollWidth) {
result.height = frame.scrollHeight;
result.width = frame.scrollWidth;
}
}
return result;
}
</script>-->
</head>
<frameset rows="42,*" cols="*">
<frame src="menu_bar.html" name="topmenu" noresize="noresize" marginwidth="20">
<frameset rows="*" cols="33%,33%,33%" border="20" bordercolor="silver">
<frameset rows="25%,25%,25%" framespacing="2" border="2" bordercolor="2">
<frame Id="frameID" name="google" src="frame_a.html" marginwidth="20">
<frame src="frame_b.html" marginwidth="20">
<frame src="frame_c.html" marginwidth="20">
</frameset>
<frameset rows="25%,25%,25%" framespacing="2" border="2" bordercolor="2">
<frame src="frame_d.html" marginwidth="20">
<frame id="frameE" src="frame_e.html" marginwidth="20">
<noframe>
<button type="button"id="button">resize</button>
</noframe>
<frame src="frame_f.html" marginwidth="20">
</frameset>
<frameset rows="25%,25%,25%" framespacing="2" border="2" bordercolor="2" id="foo">
<frame src="frame_g.html" marginwidth="20">
<frame src="frame_h.html" Id="idFrame" marginwidth="20">
<frame src="frame_i.html" marginwidth="20">
</frameset>
</frameset>
</frameset>
<script>
$("#button").click(function () {
var maxHeight = 300;
var maxwidth = 300;
if (+$('#frameE').height() && +$('#chartdiv').width() < maxHeight) {
$('#frameE').stop().animate({ height: 300,width:300, opacity: 1 }, 'slow');
} else if (+$('#frameE').height() && +$('#chartdiv').width() === maxHeight) {
$('#frameE').stop().animate({ height: 50,width:50, opacity: 1 }, 'slow');
}
});
</script>