<frameset id="boy" cols="100,*">
parent.document.all.boy.cols="0,*";

解决方案 »

  1.   

    提示top.htm第34行有错,缺少对象。
      

  2.   

    还有,好心人请给出全代码可以吗?
    假如我的Index.htm是这样的框架。(如下)____________________________
             Top.htm           |
    ___________________________|_
        |                |     |
        |                |     |
    Left|     Main.htm   |Right|
        |                |     |
        |                |     |
    ----------------------------
             Buttom.htm        |
    ----------------------------我想在Top.htm上面做2个按钮,第一个ButtonA,实现onclick时可以隐藏或显示Left.htm;
    第二个ButtonB,可以实现onclick时可以显示或隐藏Right.htm.但有一点要注意的是,Right.htm在默认的时候是不显示的。如何做呀?
      

  3.   

    框架名最好不要用"top"
    假设你把你的name="top"换成了name="top1"
    那么就是parent.document.top1.boy.cols="0,*";
    用javascript改动col即可,当字符串附值
      

  4.   

    index.htm
    _______________________________________<html>
    <script>
    var left_show=true;
    var right_show=false;
    </script>
    <head>
    <meta HTTP-EQUIV="Content-Type" CONTENT="text/html; charset=gb2312">
    <title>新建网页 2</title>
    </head><frameset rows="42,83%,*" frameborder="no">
    <frame name="Top" scrolling="no" noresize target="contents" src="Top.htm">
    <frameset id="forM" rows="*" cols="200,*,0" frameborder="no">
    <frame name="Left" target="main" src="Left.htm">
    <frame name="Main" id="Main" src="Main.htm">
    <frame name="Right" id="Right" target="main" style="display:none;" src="Right.htm" >
      </frameset>
    <frame name="Buttom" scrolling="no" noresize target="Main" src="Buttom.htm">
    <noframes>
    <body> <p>此网页使用了框架,但您的浏览器不支持框架。</p> </body>
    </noframes>
    </frameset>
    </html>_________________________________________
    Top.htm
    _________________________________________
    <html><head>
    <meta http-equiv="Content-Type" content="text/html; charset=gb2312">
    <title>新建网页 1</title>
    <base target="contents">
    </head><body><button id=lf name=lf onclick="onckl();">left</button> &nbsp;&nbsp;&nbsp;&nbsp;<button id=rf name=rf onclick="onckr()">right</button>
    </body>
    <script>
    var str=""
    function onckr()
    {
    if(parent.left_show==true) {str="200,*,";}else{str="0,*,"}if(parent.document.getElementById('Right').style.display=='none')
    {parent.document.getElementById('Right').style.display='';
    parent.document.getElementById('forM').cols=(str+'200');
    parent.right_show=true;
    document.all.rf.innerHTML="关闭右视窗";
    }
    else
    {
    parent.document.getElementById('Right').style.display='none';
    parent.document.getElementById('forM').cols=(str+'0');
    parent.right_show=false;
    document.all.rf.innerHTML="打开右视窗";
    }
    }
    function onckl()
    {
    if(parent.right_show==true) {str=",*,200";}else{str=",*,0"}
    if(parent.document.getElementById('Left').style.display=='none')
    {parent.document.getElementById('Left').style.display='';
    parent.document.getElementById('forM').cols='200'+str;
    parent.left_show=true;
    document.all.lf.innerHTML="关闭左视窗";
    }
    else
    {
    parent.document.getElementById('Left').style.display='none';
    parent.document.getElementById('forM').cols='0'+str;
    parent.left_show=false;
    document.all.lf.innerHTML="打开左视窗";
    }
    }
    </script>
    </html>
    _______________________________________________________________
    Left.htm
    ______________________________________________________________<html><head>
    <meta http-equiv="Content-Type" content="text/html; charset=gb2312">
    <title>新建网页 1</title>
    </head><body>
    left
    </body></html>
    _______________________________________________________________
    Right.htm
    ______________________________________________________________<html><head>
    <meta http-equiv="Content-Type" content="text/html; charset=gb2312">
    <title>新建网页 1</title>
    </head><body>
    right
    </body></html>
    _______________________________________________________________
    Main.htm
    ______________________________________________________________<html><head>
    <meta http-equiv="Content-Type" content="text/html; charset=gb2312">
    <title>新建网页 1</title>
    </head><body>
    My name is pansiom.
    </body></html>
      

  5.   

    最好还是不用frame,用iframe好控制呀
      

  6.   

    根据你的修改!!
    index.html
    <html><head>
    <meta HTTP-EQUIV="Content-Type" CONTENT="text/html; charset=gb2312">
    <title>新建网页 1</title>
    </head><frameset rows="64,*,64">
    <frame name="top" scrolling="no" noresize target="contents" src="top.htm">
    <frameset name="boy" cols="100,*" id='b'>
    <frame name="contents" target="main" src="left.htm" >
    <frame name="main" src="right.htm">
    </frameset>
    <frame name="bottom" scrolling="no" noresize target="contents" src="buttom.htm">
    <noframes>
    <body> <p>此网页使用了框架,但您的浏览器不支持框架。</p> </body>
    </noframes>
    </frameset></html>//top.htm文件!!<html><head>
    <meta http-equiv="Content-Language" content="zh-cn">
    <meta http-equiv="Content-Type" content="text/html; charset=gb2312">
    <title></title>
    <base target="contents">
    </head>
    <Script language="JavaScript">
    function gotoHomePage(){
     parent.main.location = "DefaultContent.htm";
    }/*
     * 显示/隐藏 窗体左侧的模块菜单
     * 显示 100
     * 隐藏 0
     */
    var clicknum = 0;
    function Show_b(){
    var num=parent.b.cols
    if(num=="100,*"){
    parent.b.cols="0,*"
    }else{
    parent.b.cols="100,*"
    }}
    </Script><body><form method="POST" action="--WEBBOT-SELF--">
    <p><input type="button" value="按钮" name="B3" onclick="Show_b()">
    <input type="submit" value="提交" name="B1"><input type="reset" value="重置" name="B2"></p>
    </form><p> </p></body></html>我测试过没问题!!!
      

  7.   

    function switchSysBar(){
    if (document.all("switchPoint").innerText==3){
    document.all("switchPoint").innerText=4;
    document.all("frmTitle").style.display="none";
    }else{
    document.all("switchPoint").innerText=3;document.all("frmTitle").style.display="";}}其中 frmTitle:
              <td width="150" height="100%" align=middle valign="top"   id=frmTitle>
                <iframe  frameborder="1"  name=window_left scrolling="auto" src="left.jsp"  style="HEIGHT:100%;VISIBILITY:inherit;WIDTH:155;Z-INDEX:2"></iframe>