html框架折叠的javascript实现

我有两个htm文件,下面是Main.htm的源码:

<html>
  <head>
    <title>主框架</title>
    <meta http-equiv=content-type content="text/html;charset=gb2312">   
  </head>
  <frameset border="0" framespacing="0" rows="51,*,0,0" frameBorder="0">
    <frame id="daoHangTiao" name="daoHangTiao" src="daoHangTiao.htm" frameBorder="0" noResize scrolling="no">
    <frameset border="0" name="main" frameSpacing="1" frameBorder="0" cols="503,*" scrolling="auto">
      <frame id="leftFrame" border="0" name="leftFrame" marginWidth="0" frameSpacing="0" marginHeight="0" src="leftFrame.htm" frameBorder="0" scrolling="no">
      <frame id="right" border="0" name="right" frameSpacing="0" src="rightIndex.htm" frameBorder="0">
    </frameset>
    <frame border="0" name="online" frameSpacing="0" src="online.htm" frameBorder="0" noResize scrolling="no">
    <frame border="0" name="function" frameSpacing="0" src="function.htm" frameBorder="0" noResize scrolling="no">
  </frameset>
</html>

以下是 leftFrame.htm 的源码:

<html>
  <head>
    <title>leftFrame</title>
    <script language=javascript>
      function changeWin(){
        if(parent.main.cols!='0,*' && parent.main.cols!='5,*'){
          parent.main.cols='5,*';
          ImgArrow.src="bl_1.gif";
        }else{
          parent.main.cols='503,*';
          ImgArrow.src="al_1.gif";
        }
      }
    </script>
    <meta http-equiv=content-type content="text/html;charset=gb2312">
  </head>

  <body bgColor="#8d989a" leftMargin="0" topMargin="0">
    <table height="100%" cellSpacing="0" cellPadding="0" width="100%" border="0">
      <tbody>
      <tr>
        <td width="100%">
          <iframe id="leftiframe" style="VISIBILITY:inherit;WIDTH:100%;HEIGHT:100%" name="leftiframe" src="leftMain.htm" frameBorder="0">
          </iframe>
        </td>
        <td bgColor="#d0d0c8">
          <table id="td1" height="100%" cellSpacing="0" cellPadding="0" width="100%" bgColor="#d7d8da border="0">
            <tbody>
              <tr>
                <td title="拖动以调整宽度" height="50%">
                </td>
              </tr>
              <tr>
                <td height="96">
                  <img id=ImgArrow οnclick=changeWin() alt="展开/关闭帖子列表" src="al_1.gif" width="5" border="0" name="ImgArrow" style="currsor:hand">
                </td>
              </tr>
              <tr>
                <td title="拖动以调整宽度" height="50%">
                </td>
              </tr>
             </tbody>
           </table>
         </td>
      </tr>
      </tbody>
    </table>
  </body>
</html>

另外,我还有两个gif图片(就是一个向右的三角箭头与向左的三角箭头,也可以自己PS两个),下载地址如下:

http://txt.mop.com/dzh/centerframe/al_1.gif

http://txt.mop.com/dzh/centerframe/bl_1.gif

将上面四个文件放在同一目录下,即可正常运行Main.htm查看出框架折叠的效果!

  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值