index.htm<html>
<head>
<title>index</title>
<meta http-equiv="Content-Type" content="text/html; charset=gb2312">
</head>
<body>
<input type=button onclick="top.frames['mainFrame'].baobao.cols='0,100%'" value="隐藏">
<input type=button onclick="top.frames['mainFrame'].baobao.cols='*,630'" value="显示">
<br>
<iframe src="main/index_f.htm"  name="mainFrame" id="mainFrame" frameborder="1" width="980" height="640" application="no">
</iframe>
</body>
</html>
index_f.htm<html>
<head>
<title>Untitled Document</title>
<meta http-equiv="Content-Type" content="text/html; charset=gb2312">
</head><frameset rows="*" cols="*,630" framespacing="1" frameborder="yes" border="1" name="ColFrameSet" id="baobao">
  <frame src="left.htm" name="leftVRML" scrolling="NO" noresize>
  <frame src="right.htm" name="RightControl">
</frameset>
<noframes><body>
</body></noframes>
</html>

解决方案 »

  1.   

    index_f.htm中修改一下:
    <frameset id=frmset rows="*" cols="*,630" framespacing="1" frameborder="yes" border="1" name="ColFrameSet">
      <frame src="left.htm" name="leftVRML" scrolling="NO" noresize>
      <frame src="right.htm" name="RightControl">
    </frameset>
    设置frameset元素的id = frmset然后,在index.htm中添加下面js代码:
    <script language="JScript">
    function resize(){  var oMainFrm = document.frames("mainFrame");  oMainFrm.document.all("frmset").cols = "*,200";}
    </script>最后,在下面语句中调用:
    <input type=button onclick="resize()" value="大小变换">