分栏的javascript代码

index.htm页面代码
<html>
<head>
<meta HTTP-EQUIV="Content-Type" CONTENT="text/html; charset=gb2312">
<meta name="GENERATOR" content="Microsoft FrontPage 4.0">
<meta name="ProgId" content="FrontPage.Editor.Document">
<title>frame框架的显示隐藏操作</title>
</head>

<frameset name="full" rows="64,*,64">
  <frame name="top" scrolling="no" xnoresize target="contents" src="top.htm">
  <frameset cols="25%,*" name="cen">
    <frame name="contents" target="main" src="left.htm">
    <frame name="main" src="main.htm">
  </frameset>
  <frame name="bottom" scrolling="no" xnoresize target="contents" src="bottom.htm">
  <noframes>
  <body>

  <p>此网页使用了框架,但您的浏览器不支持框架。</p>

  </body>
  </noframes>
</frameset>
</html>


main.htm页面代码

<html>

<head>
<meta http-equiv="Content-Type" content="text/html; charset=gb2312">
<meta name="GENERATOR" content="Microsoft FrontPage 4.0">
<meta name="ProgId" content="FrontPage.Editor.Document">
<title>main - 51windows.net</title>
</head>

<body>
<SCRIPT LANGUAGE="JavaScript">
<!--
function shtop(){
        if (parent.full.rows.indexOf("0,*,")!=-1){
                parent.full.rows="64,*,"+parent.full.rows.split(",")[2]
                document.getElementById("shtop").value="隐藏上部";
        }
        else{
                parent.full.rows="0,*,"+parent.full.rows.split(",")[2]
                document.getElementById("shtop").value="显示上部";
        }
}
function shleft(){
        if (parent.cen.cols=="0,*"){
                parent.cen.cols="25%,*,"
                document.getElementById("shleft").value="隐藏左部";
        }
        else{
                parent.cen.cols="0,*"
                document.getElementById("shleft").value="显示左部";
        }
}
function shbottom(){
        if (parent.full.rows.indexOf(",*,0")!=-1){
                parent.full.rows=parent.full.rows.split(",")[0]+",*,64"
                document.getElementById("shbottom").value="隐藏下部";
        }
        else{
                parent.full.rows=parent.full.rows.split(",")[0]+",*,0"
                document.getElementById("shbottom").value="显示下部";
        }
}
function maxmain(){
        if (parent.full.rows=="0,*,0"){
                parent.full.rows="64,*,64"
                parent.cen.cols="25%,*"
                document.getElementById("maxmain").value="隐藏左上下";
                document.getElementById("shtop").value="隐藏上部";
                document.getElementById("shleft").value="隐藏左部";
                document.getElementById("shbottom").value="隐藏下部";
        }
        else{
                parent.full.rows="0,*,0";
                parent.cen.cols="0,*";
                document.getElementById("maxmain").value="显示左上下";
                document.getElementById("shtop").value="显示上部";
                document.getElementById("shleft").value="显示左部";
                document.getElementById("shbottom").value="显示下部";
        }
}
//-->
</SCRIPT>
<input type="button" name="maxmain" id="maxmain" οnclick="maxmain();" value="隐藏左上下">
<input type="button" name="shtop" id="shtop" οnclick="shtop();" value="隐藏上部">
<input type="button" name="shleft" id="shleft" οnclick="shleft();" value="隐藏左部">
<input type="button" name="shbottom" id="shbottom" οnclick="shbottom();" value="隐藏下部">

</body>

</html>

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

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

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

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

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

抵扣说明:

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

余额充值