今天玩的时候遇到了一个问题,是html的,直接看问题吧,野猪~

index.html页面:

<frameset rows="98,*,8" frameborder="no" border="0" framespacing="0">
  <frame src="top.html" name="topFrame" scrolling="No" noresize="noresize" id="topFrame" />
  <frame src="center.html" name="mainFrame" id="mainFrame" />

  <frame src="down.html" name="bottomFrame" scrolling="No" noresize="noresize" id="bottomFrame" />
</frameset>

center.html页面:

<body>
<table width="100%" height="100%" border="0" cellpadding="0" cellspacing="0" style="table-layout:fixed;">
  <tr>
    <td><iframe id="center" name="I2" height="100%" width="100%" border="0" frameborder="0" src="middel.html"> 浏览器不支持嵌入式框架,或被配置为不显示嵌入式框架。</iframe></td>
    <td width="6" bgcolor="#1873aa" style=" width:6px;">&nbsp;</td>
  </tr>
</table>
</body>

middel.html页面:

<body style="overflow:hidden">
<table width="100%" height="100%" border="0" cellpadding="0" cellspacing="0" style="table-layout:fixed;">
  <tr>
    <td width="171" id=frmTitle noWrap name="fmTitle" align="center" valign="top"><table width="171" height="100%" border="0" cellpadding="0" cellspacing="0" style="table-layout:fixed;">
      <tr>
        <td  bgcolor="#1873aa" style="width:6px;">&nbsp;</td>
        <td width="165"><iframe id="middel" name="I1" height="100%" width="165" border="0"  src="left.html"  frameborder="0" scrolling="no"> 浏览器不支持嵌入式框架,或被配置为不显示嵌入式框架。</iframe></td>
      </tr>
    </table>        </td>
    <td width="6"  style="width:6px;"valign="middle" bgcolor="1873aa" class=navPoint
id=switchPoint title=关闭/打开左栏><img src="p_w_picpaths/main_55.gif" name="img1" width=6 height=40 id=img1></SPAN></td>
    <td width="100%" align="center" valign="top"><iframe name="I2" height="100%" width="100%" border="0" frameborder="0" src="tab/tab.html"> 浏览器不支持嵌入式框架,或被配置为不显示嵌入式框架。</iframe></td>
  </tr>
</table>
</body>

top.html页面:

<a href="" onClick="parent.mainFrame.document.getElementById('center').contentWindow.document.getElementById('middel').src='left.html';">
                                <div align="center" class="STYLE3">
                                公告通知
                                </div></a>

上面是基本的情况,在大概说一下,野猪想在top.html中加入几个超链接,然后点击不同的超连接在mainFrame中的IFrame中显示不同的页面,这里应该是用到了dom,就是这棵树的关系,先由topFrame返回到Parent,在进入mainFrame,在进入相应的IFrame中,然后再改动,其实想想挺简单的,没什么,但是野猪的js学的不是很好……仅仅是会一点点,所以这稍微卡了一下壳……不过还好,解决了……

野猪,记住啦!