up,up,up,up,up,up,up,up,up,up给我十分,如何?:)

解决方案 »

  1.   

    function selectstart()
      {
      window.event.cancelBubble = true;
      window.event.returnValue = false;
      return false;
      }事件冒泡
    <body onclick="alert('body')">
    <div onclick="alert('div')">click me</div>
    <div onclick="alert('div');event.cancelBubble=true">click me</div>
    </body>
    你试一下这个就知道cancelBubble到底是怎么回事了
      

  2.   

    top.mainframeset.cols = "1,*";//改变mainframeset的宽度设置,  top.contentbar.document.all("showtoc").style.display = "block";//设置showtoc的显示属性为使可见
      

  3.   

    top.mainframeset.cols = "1,*";//改变mainframeset的宽度设置,
    top.contentbar.document.all("showtoc").style.display = "block";//设置showtoc的显示属性为使可见多谢aotianlong(初中没毕业)
    但是mainframeset和contentbar都不是框架名,也就是说并不存在这样的代码
    <FRAME name="contentbar">,只是有一个名叫contentbar的asp文件
    代码如下,你也可以看看源文件:)
        <frameset rows="30,*" border="0" framespacing="0" topmargin="0" leftmargin="0" marginheight="0" marginwidth="0">
          <frame name="fraContentBar" src="/expert/deeptree/contentbar.asp?xmlsrc=/Expert/deeptree/Rooms/List.xml&csdnstyle=&hidetoc=false&myie=ie" scrolling="no" border="0" frameborder="no" noresize></frame>
          <frame name="fraContent" src="/Expert/ForumList.asp?roomid=301&typenum=1" scrolling="yes" border="0" frameborder="no" noresize></frame>
        </frameset>
      

  4.   

    function hidetoc()
      {
      top.mainframeset.cols = "1,*"; //id为mainframeset的frameset,只有frameset可以设置cols和rows
      top.contentbar.document.all("showtoc").style.display = "block";//对名为contentbar的框架里的页面做操作
      }
      

  5.   

    楼上的老大,不存在名为mainframeset的frameset,也不存在名为contentbar的frame
      

  6.   

    position:absolute;
    在IE中,此时,不一定是距窗口的的左上角来定位!如果它的父级元素中有设置了position:absolute的,就会按这个父级元素来定位。同时,在设置了position:absolute时,如果没有设置top/left,不会影响它在页面中的实际位置。知道了这两点,就很容易了,看这个:http://www.yesky.com/SoftChannel/72351167954550784/20030806/1719651.shtml
      

  7.   

    似乎只有frameset才有cols属性啊。
    mainframeset为frameset无疑
      

  8.   

    我不知道你是如何写的,可以看看这个测试
    <frameset id="mainframeset" rows="50,50" border="0" framespacing="0" topmargin="0" leftmargin="0" marginheight="0" marginwidth="0">
          <frame name="fraContentBar" src="fff1.htm" scrolling="no" border="0" frameborder="no" noresize></frame>
          <frame name="fraContent" src="fff2.htm" scrolling="yes" border="0" frameborder="no" noresize></frame>
    </frameset>fff1.htm
    <input type=button value=test onclick='top.mainframeset.rows = "100,*"'>fff2.htm
    <input type=button value=test onclick='top.mainframeset.rows = "*,100"'>
      

  9.   

    xuzuning(唠叨):fff1.htm和fff2.htm都需要是框架文件,然后用fff1.htm中包含的一个文件中的脚本改变fff2.htm中包涵的一个文件中的一个图片的style属性
    别嫌我麻烦,csdn就是这样做的:)
      

  10.   

    点击目录树右上叫的叉,可以改变frameset的cols属性,同时显示右边的图片(显示菜单)
      

  11.   

    function selectstart()
      {
      window.event.cancelBubble = true;   //处理该事件,不让别其他元素看到.
      window.event.returnValue = false;   //禁止执行默认动作.
      return false;
      }cancelBubble,returnValue  都是IE的事件对象.
    function hidetoc()
      {
      top.mainframeset.cols = "1,*";  //top最顶层.mainframeset是框架的名啊.
      top.contentbar.document.all("showtoc").style.display = "block";
      }//这样写就行了.
    //top.RightFrame.RightTop.document.all("showdoc").style.display = "block";
      

  12.   

    其实本站的源代码里已经很有了。出错一般是frame名字或者路径引起的
      

  13.   

    http://freedownload.myrice.com/lu/lucky/temp/XML.zip
    无帧的例子
      

  14.   

    是框架名,有可能在那src属性指定的asp文件将name名字改了也不准哦:)
    关键你要具体看看引用的asp文件中具体的代码是什么,看是不是有改frameset框架名字的代码
      

  15.   

    还没有解决:(
    我把代码都贴出来,大家帮我看看吧
    Frame.htm     //主框架
    <HTML>
      <HEAD>
        <META http-equiv="Content-Type" content="text/html; charset=gb2312">
        <META HTTP-EQUIV="Pragma" CONTENT="no-cache">
        <META HTTP-EQUIV="Cache-Control" CONTENT="no-cache">
        <META HTTP-EQUIV="Expires" CONTENT="0">
        <TITLE>Welcome</TITLE>
        <SCRIPT LANGUAGE="JavaScript">
          // this page should never load inside of another frame
          if (top.location != self.location)
            {
     top.location = self.location;
            }
        </SCRIPT>
      </HEAD>
      <FRAMESET rows="81,*" border="1" FRAMESPACING="0" TOPMARGIN="0" LEFTMARGIN="0" MARGINHEIGHT="0" MARGINWIDTH="0">
      <FRAME name="fraToolbar" SRC="Top.htm" scrolling="no" border="0" frameborder="no" noresize TOPMARGIN="0" LEFTMARGIN="0" MARGINHEIGHT="0" MARGINWIDTH="0">
      </FRAME>
        <FRAMESET name="fstMain" cols="216,*" border="1" frameborder="1" FRAMESPACING="10" TOPMARGIN="0" LEFTMARGIN="0" MARGINHEIGHT="0" MARGINWIDTH="0">
          <FRAME name="fraLeftFrame" src="LeftFrame.htm" TOPMARGIN="0" LEFTMARGIN="0" MARGINHEIGHT="0" MARGINWIDTH="0" FRAMEBORDER="1" BORDER="1">
          </FRAME>
          <FRAME name="fraRightFrame" SRC="RightFrame.htm" FRAMEBORDER="no" BORDER="0" BORDERCOLOR="#6699CC">
          </FRAME>
        </FRAMESET>
      </FRAMESET>
    </HTML>
      

  16.   

    主框架中的3个页面,Top.htm,LeftFrame.htm,RightFrame.htm
    Top.htm    代码略
    LeftFrame.htm
    <HTML>
      <HEAD>
        <META http-equiv="Content-Type" content="text/html; charset=gb2312">
        <META HTTP-EQUIV="Pragma" CONTENT="no-cache">
        <META HTTP-EQUIV="Cache-Control" CONTENT="no-cache">
        <META HTTP-EQUIV="Expires" CONTENT="0">
        <TITLE>LeftFrame</TITLE>
      </HEAD>
      <frameset rows="21,*" border="0" framespacing="0" topmargin="0" leftmargin="0" marginheight="0" marginwidth="0">
        <frame name="LeftTop" src="LeftTop.htm" scrolling="no" border="0" frameborder="no" noresize>
        </frame>
        <frame name="LeftTree" src="LeftTree.htm" scrolling="auto" border="0" frameborder="no" noresize>
        </frame>
      </frameset>
    </HTML>
      

  17.   

    LeftTree.htm生成树型结构,使用了moonpiazza提供的xml树代码,代码略。thanks
    LeftTop.htm
    <HTML>
      <HEAD>
      <TITLE>LeftTop</TITLE>
      <META http-equiv=Content-Type content="text/html; charset=gb2312">
      <META HTTP-EQUIV="Pragma" CONTENT="no-cache">
      <META HTTP-EQUIV="Cache-Control" CONTENT="no-cache">
      <META HTTP-EQUIV="Expires" CONTENT="0">
      <script language="JavaScript" type="text/JavaScript">
        var strColumns_Current = "216,*";
        function hidetoc()
        {
          strColumns_Current = top.fstMain.cols  
          top.fstMain.cols = "1,*";                   //工作正常
          //top.fraRightFrame.RightTop.document.all("showtoc").style.display = "block";
          //top.frames.fraRightFrame.frames.RightTop.document.all("showtoc").style.display = "block";             //以上两种写法都错:缺少对象
        }
        function showtoc()
        {
          top.fstMain.cols = strColumns_Current;
          top.fstMain.RightFrame.document.all("showtoc").style.display = "none";
        }
        function mouseover(item)
        {
          switch (item)
          {
            case "synctoc" :
              window.status = "同步菜单中的当前页";
              document.all.imgSyncToc.src = "Images/synctoc2.gif"
              break;        case "hidetoc" :
              window.status = "隐藏菜单";
              document.all.imgHideToc.src = "Images/hidetoc2.gif"
            break;
          }    }    function mouseout(item)
        {
          switch (item)
          {
            case "synctoc" :
              window.status = "";
              document.all.imgSyncToc.src = "Images/synctoc1.gif"
              break;        case "hidetoc" :
              window.status = "";
              document.all.imgHideToc.src = "Images/hidetoc1.gif"
              break;
            }
        }    function selectstart()
        {
          window.event.cancelBubble = true;
          window.event.returnValue = false;
          return false;
        }  </script>
      </HEAD>
    <body onselectstart="selectstart();" bgcolor="#6699CC" leftmargin="0" topmargin="0" marginheight="0" marginwidth="0">
    <table width="100%" border="0" cellpadding="0" cellspacing="0">
      <tr> 
        <td width="100%"><DIV id="lefttop" align="right" height="20"><img id="imgHideToc" src="images/hidetoc1.gif" onclick="hidetoc();" onmouseover="mouseover('hidetoc');" onmouseout="mouseout('hidetoc');"></DIV>
        </td>
      </tr>
    </table>
    </body>
    </HTML>
      

  18.   

    右边的框架RightFrame.htm
    <HTML>
      <HEAD>
        <META http-equiv="Content-Type" content="text/html; charset=gb2312">
        <META HTTP-EQUIV="Pragma" CONTENT="no-cache">
        <META HTTP-EQUIV="Cache-Control" CONTENT="no-cache">
        <META HTTP-EQUIV="Expires" CONTENT="0">
        <TITLE>RightFrame</TITLE>
      </HEAD>
      <frameset rows="21,*" border="0" framespacing="0" topmargin="0" leftmargin="0" marginheight="0" marginwidth="0" name="RightFrame">
        <frame name="RightTop" src="RightTop.htm" scrolling="no" border="0" frameborder="no" noresize>
        </frame>
        <frame name="RightMain" src="Welcome.htm" scrolling="auto" border="0" frameborder="no" noresize>
        </frame>
      </frameset>
    </HTML>
      

  19.   

    Welcome.htm代码略
    RightTop.htm
    <HTML>
      <HEAD>
        <TITLE>RightTop</TITLE>
        <META http-equiv=Content-Type content="text/html; charset=gb2312">
        <META HTTP-EQUIV="Pragma" CONTENT="no-cache">
        <META HTTP-EQUIV="Cache-Control" CONTENT="no-cache">
        <META HTTP-EQUIV="Expires" CONTENT="0">
        <script language="JavaScript" type="text/JavaScript">
          function selectstart()
          {
       window.event.cancelBubble = true;
       window.event.returnValue = false;
       return false;
          }
        </script>
      </HEAD>
      <body onselectstart="selectstart();" bgcolor="#6699CC" leftmargin="0" topmargin="0" marginheight="0" marginwidth="0">
      <DIV name="showtoc" align="right" height="20" style="display:none;">
      <table width="100%" border="0" cellpadding="0" cellspacing="0" onclick="top.????.showtoc();" style="cursor:hand">
        <!-- 上面的onclick事件也不知道该怎么写 -->
        <tr> 
          <td width="30%"><img id="imgHideToc" src="images/showtoc.gif"><font face="verdana" color="#FFFFFF">显示目录树</font>
          </td>
          <td width="70%"></td>
        </tr>
      </table>
      </div>
    </body>
    </HTML>