大侠出手了,教导我用frame,看来框架是最常用的办法。

解决方案 »

  1.   

    frame就是window下的一个子窗口,在window里用frame的id来访问frame,在frame里用parent来访问上层的window
    就是这样了
    一个框架的源码:
    <html>
    <head>
    <meta http-equiv="Content-Type" content="text/html; charset=gb2312">
    <title>Untitled Document</title>
    </head><frameset rows="80,*" cols="*" frameborder="NO" border="0" framespacing="0">
      <frame src="header.htm" name="topFrame" scrolling="NO" noresize >
      <frameset cols="80,*" frameborder="NO" border="0" framespacing="0">
        <frame src="left.htm" name="leftFrame" scrolling="NO" noresize>
        <frame src="right.htm" name="mainFrame">
      </frameset>
    </frameset>
    <noframes><body>
    </body></noframes>
    </html>
    这个是DW自动生成的,不合适的地方自己改
      

  2.   

    我不想用frame,同志们,如何做?
      

  3.   

    <html>
    <head><title>afasdfasd</title>
      <style type="text/css"> 
        .left { float:left; padding:0px; margin:4px; width: 25%; height:400px; background:#dd0066;overflow:hidden;}
        .splitter{FLOAT:left; WIDTH:5px; CURSOR:col-resize; HEIGHT:100%; BACKGROUND-COLOR:#0000ff; position:relative }
        .center { float:left; padding:0px; margin:4px; width: 65%; height:400px;background:#00ee00;overflow:hidden;}
      </style>
    </head>
    <body>
      <div><img src="images/topbar.gif"></div>
      <form id="Form1" method="post" class="content">
        <DIV id="divLeft" class="left">sdfgsdg</DIV>
        <div id="divSplitter" class="splitter" onclick="document.Form1.divLeft.style.width=0;document.Form1.divRight=document.Form1.divLeft.style.width + document.Form1.divRight;"></div>
        <DIV class="center" id="divRight">sdfgsdf</DIV> 
      </form>
    <!--DIV class=footer>Footer</DIV -->
    </body>
    </html>
    请问:我上面这段源文件中onclick="document.Form1.divLeft.style.width=0;document.Form1.divRight=document.Form1.divLeft.style.width + document.Form1.divRight;"
    提示:错误:“document.Form1.divLeft 为空或不是对象”是何原因?