有一个frame,上下两部分,如何实现这样的功能:在下面的页面中放置一个按钮,按一下按钮该框架部分扩大到整个浏览器,再按一下还原成原来的大小。要用客户端脚本。谢谢。

解决方案 »

  1.   

    给你一个这样的例子,它是分左中右三部分的,你稍微改一下就可以用了,原理是一样的
    <html>
    <head>
    <meta name="vs_targetSchema" content="http://schemas.microsoft.com/intellisense/ie5">
    <style>
    </style>
    <script>
    function hideIt()
    {
    if (switchPoint1.innerText==7){
    switchPoint1.innerText=8

    top.forum.cols = "0,17,*";
    }
    else{
    switchPoint1.innerText=7
    top.forum.cols="150,17,*"
    }

    if (switchPoint2.innerText==7){
    switchPoint2.innerText=8

    top.forum.cols = "0,17,*";
    }
    else{
    switchPoint2.innerText=7
    top.forum.cols="150,17,*"
    }
    }function logout()
    {
    return false;
    nw =window.open ("logout.aspx","_blank","width=1,height=1");
    nw.moveTo(2000,50);
    }
    </script>
    </head>
    <body leftmargin="0" border="0" topmargin="0" bgcolor="#d9f2ff" rightmargin="0" onunload="logout()"
    scroll="no" style="BORDER-RIGHT: #A8CBF1 1px solid">
    <div style="HEIGHT:100%;v-align:middle"><FONT face="宋体"></FONT><FONT face="宋体"></FONT><FONT face="宋体"></FONT>
    <DIV style="HEIGHT:20%"></DIV>
    <a href='javascript:hideIt()'><SPAN id="switchPoint1" style="FONT-SIZE: 9pt; CURSOR: hand; COLOR: blue; FONT-FAMILY: Webdings; TEXT-DECORATION: none">
    7</SPAN></a>
    <DIV style="HEIGHT:60%"></DIV>
    <a href='javascript:hideIt()'><SPAN id="switchPoint2" style="FONT-SIZE: 9pt; CURSOR: hand; COLOR: blue; FONT-FAMILY: Webdings; TEXT-DECORATION: none">
    7</SPAN></a>
    </div>
    </body>
    </html>
      

  2.   

    我是这样做的:
    function hideIt()
    {
    if (switchButton.innerText=='扩大')
    {
    switchButton.innerText='还原'
    top.forum.rows = "0,*" }
    else
    {
    switchButton.innerText='扩大'
    top.forum.rows = "500,*";
    }

    }执行之后没有反应,有什么错误?