⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 mztreeview10.htm

📁 asfd asf
💻 HTM
字号:
<html>
  <head>
    <script language=javascript>var t1 = new Date().getTime();</script>
    <meta http-equiv="Content-Type" content="text/html; charset=gb2312">
   
    <script language="JavaScript" src="MzTreeView10.js"></script>
    <title>梅花雪中文网 - WEB版块管理界面</title>
    <style type="text/css">
    body, td
    {
      font-family: 宋体;
      font-size: 12px;
    }
    A:LINK, A:VISITED, A:ACTIVE, A:HOVER
    {
      color: #800080;
      font-size: 13px;
      padding-left: 3px;
      TEXT-DECORATION: NONE;
    }
    </style>
    <SCRIPT LANGUAGE="JavaScript">
    function getQuery(name)
    {
      var reg = new RegExp("(^|&)"+ name +"=([^&]*)(&|$)");
      var r = window.location.search.substr(1).match(reg);
      if (r!=null) return unescape(r[2]); return null;
    }
    function getObjectById(id)
    {
      if (typeof(id) != "string" || id == "") return null;
      if (document.all) return document.all(id);
      if (document.getElementById) return document.getElementById(id);
      try {return eval(id);} catch(e){ return null;}
    }
    function reRun()
    {
      var url = "demo.htm";
      url += "\?total="+ document.forms[0].total.value;
      url += "&childNodes="+ document.forms[0].childNodes.value;
      window.location.href = url;
    }
    window.onload = function()
    {
      getObjectById("focusId").value = tot-1;
      getObjectById("msgNode").innerHTML  = "树的总节点数:"+ tot +"<br>单节点下的子节点数:"+ cns;
      getObjectById("TimeShow").innerHTML = "加载本页耗时 "+ (new Date().getTime()-t1) +" 毫秒";
    }
    </SCRIPT>
  </head>

  <body>
    
<h3 style="margin-bottom: 0">&nbsp;</h3>
    <form method="get" style="padding: 3; background-color: #B8D1F8; margin-bottom: 0">
      <fieldset>
        
  <legend></legend>
  </fieldset>
    </form>
    
<table width="100%" border=0 cellspacing=3 bgcolor="#B8D1F8">
  <tr> 
    <td bgcolor=white valign=top> <div id=treeviewarea style="background-color: "></div>
      <SCRIPT LANGUAGE="JavaScript">
          <!--
          var tree = new MzTreeView("tree");
          tree.setIconPath("./");
          tree.nodes['-1_1'] = 'text:节点 1';
          tree.nodes['1_2'] = 'text:节点 2';
          tree.nodes['1_3'] = 'text:节点 3';
          tree.nodes['1_4'] = 'text:节点 4';
          tree.nodes['1_5'] = 'text:节点 5';
          tree.nodes['1_6'] = 'text:节点 6';
          tree.nodes['1_7'] = 'text:节点 7';
          tree.nodes['1_8'] = 'text:节点 8';
          tree.nodes['1_9'] = 'text:节点 9';
          tree.nodes['1_10'] = 'text:节点 10';


          var tot = getQuery("total");      tot = !tot || isNaN(tot) ? 1024 : tot;
          var cns = getQuery("childNodes"); cns = !cns || isNaN(cns) ? 10 : cns;
          with(document.forms[0])
          {
            total.value = tot;
            childNodes.value = cns;
          }
          for (i=11; i<tot; i++)
            tree.nodes[Math.floor(Math.random()*(tot/cns))+2 +"_"+ i] = 'text:节点 '+ i;



          document.getElementById('treeviewarea').innerHTML = tree.toString();
          //下面这句代码就是一展开即聚焦到某一节点上的示例
          setTimeout("tree.focus('3', true); tree.expand(tree.currentNode.id, true);",10);
          
          
          if(typeof(Function.prototype.apply)!="function")
          {
            Function.prototype.apply = function(obj, argu){var s; if(obj){obj.constructor.prototype._caller=this; s = "obj._caller";} else s = "this"; var a=[]; for(var i=0; i<argu.length; i++) a[i] = "argu["+ i +"]"; return eval(s +"("+ a.join(",") +");");};
            Function.prototype.call  = function(obj){var a=[]; for(var i=1; i<arguments.length; i++) a[i-1]=arguments[i]; return this.apply(obj, a);}; 
          }
          tree.buildNode = function(id)
          {
            var d = new Date().getTime();

            MzTreeView.prototype.buildNode.call(this, id);

            try{
            getObjectById("TimeNode").innerHTML = "<u><b>"+ this.node[id].text +"</b></u> 有 "+
              this.node[id].childNodes.length +" 个子节点<br>加载耗时:"+ (new Date().getTime()-d) +" 毫秒!";
            }catch(e){}
          }
          tree.expandAll = function()
          {
            var d = new Date().getTime();
            MzTreeView.prototype.expandAll.call(this);
            alert("全部展开耗时 = "+ (new Date().getTime()-d) +
            " 毫秒!\r\n有效节点总数 = "+ (this.index+1));
          }
          //-->
          </SCRIPT> </td>
  </tr>
</table>
  </body>
</html>

⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -