<rt id="bn8ez"></rt>
<label id="bn8ez"></label>

  • <span id="bn8ez"></span>

    <label id="bn8ez"><meter id="bn8ez"></meter></label>

    隨筆 - 154  文章 - 60  trackbacks - 0
    <2007年10月>
    30123456
    78910111213
    14151617181920
    21222324252627
    28293031123
    45678910

    聲明:

    該blog是為了收集資料,認識朋友,學習、提高技術(shù),所以本blog的內(nèi)容除非聲明,否則一律為轉(zhuǎn)載!!

    感謝那些公開自己技術(shù)成果的高人們!!!

    支持開源,尊重他人的勞動!!

    常用鏈接

    留言簿(3)

    隨筆分類(148)

    隨筆檔案(143)

    收藏夾(2)

    其他

    學習(技術(shù))

    觀察思考(非技術(shù))

    搜索

    •  

    最新評論

    閱讀排行榜

    評論排行榜

    <button onclick=s.moveNext()>next</button><button onclick=s.movePre()>pre</button><button onclick=s.reLoad()>reload</button>
    <script>
    function eyunTree(Tname)
      {if(typeof(Tname) != "string" || Tname == "")
         throw(new Error(-1, '創(chuàng)建類實例的時候請把類實例的引用變量名傳遞進來!'));
       this.O=null;
       this.tree="";
       this.nodes=new Array();
       this.header="<table border='0'  height='20' cellspacing='0' cellpadding='1'>\r\n";
       this.footer="</table>\r\n";
       this.style= "<style type='text/css'>\r\n";
       this.style+="  td{white-space: nowrap;font:9pt/150% '宋體';}\r\n";
       this.style+="  .on{cursor:hand;background-color:#B5BED6;border:1px solid #08246B;}\r\n";
       this.style+="  .click{cursor:hand;background-color:#FFFFFF;border:1px solid #B5BED6;}\r\n";
       this.style+="</style>";
       this.addNode=function (parent,text,hasChild,href,target)
                      {if(hasChild!=1 && arguments.length!=5)
                         throw(new Error(-2, '參數(shù)錯誤!'));
                       var nodeHeader="  <tr style='display:none'>\r\n    <td><table style='margin-left:15' border='0'  height='20' cellspacing='0' cellpadding='1'>\r\n";
                       var nodeFooter="</table></td>\r\n  </tr>\r\n";
                       var treeHead="  <tr>\r\n";
                       treeHead+=   "    <td><span onclick='"+Tname+".nodeClick(this)' onmouseout='"+Tname+".nodeOut(this)' onmouseover='"+Tname+".nodeOver(this)'";
                       var treeFoot="</span></td>\r\n";
                       treeFoot+=   "  </tr>\r\n";
                       var treeNode=treeHead+"hasChild='"+hasChild+"'";
                       if(hasChild!=1)
                         {treeNode+=" href='"+href+"' target='"+target+"'";
                          var src="comm/img/tree/leaf.gif";
                         }
                       else
                         var src="comm/img/tree/shrink.gif"
                       treeNode+="><img src='"+src+"' align='absmiddle'>"+text+treeFoot;
                       if(parent=="root")
                          treeNode=this.header+treeNode;
                       if(hasChild==1)
                         {treeNode+=nodeHeader;
                         }
                       if(this.tree!="" && this.nodes.length!=0)
                         {if(parent=="root")
                            {while(this.nodes.length>0)
                               {this.tree+=nodeFooter;this.nodes.length--}
                             this.tree+=this.footer;
                            }
                          else
                            {if(this.nodes[this.nodes.length-1]!=parent && this.tree.lastIndexOf(parent)!=this.tree.length-parent.length)
                               {while(this.nodes.length-1>0)
                                 {if(this.nodes[this.nodes.length-1]!=parent)
                                    this.tree+=nodeFooter;
                                  else
                                    break;
                                  this.nodes.length--
                                 }                             
                               }
                             }
                         }
                       if(this.nodes[this.nodes.length-1]!=parent)
                         this.nodes[this.nodes.length]=parent;
                       this.tree+=treeNode;
                       return treeNode;
                      }
        this.nodeOver=function (o)
                      {o.oldClass=o.className;
                       o.className="on";
                      }
        this.nodeOut=function (o)
                       {o.className=o.oldClass;
                       }
        this.nodeClick=function (o)
                         {if(o.hasChild=="1")
                            {if(o.type=="open")
                               this.treeClose(o);
                             else
                               this.treeOpen(o);
                            }
                          else
                            {tmpA.href=typeof o.href=="undefined"?"#":o.href;
                             tmpA.target=typeof o.target=="undefined"?"_self":o.target;
                             tmpA.click();
                            }
                          if(this.O!=null)
                            this.O.className=this.O.oldClass="";
                          this.O=o;
                          o.oldClass=o.className="click";
                         }
        this.treeClose=function (o)
                         {o=o.parentElement.parentElement;
                          o.nextSibling.style.display="none";
                          o.firstChild.firstChild.firstChild.src="comm/img/tree/shrink.gif";
                          o.firstChild.firstChild.type="close";
                         }

        this.treeOpen=function (o)
                        {o=o.parentElement.parentElement;
                         o.nextSibling.style.display="";s
                         o.firstChild.firstChild.firstChild.src="comm/img/tree/unwrap.gif";
                         o.firstChild.firstChild.type="open";
                        }
        this.moveNext=function ()
                        {var o=document.getElementsByTagName("SPAN");
                         var l=o.length;
                         if(this.O==null)
                           {o[0].click(o[0]);  
                            return true;
                           }
                         for(var i=0;i<l;i++)
                           if(o[i].className==this.O.className)
                             break;
                        if(i<l-1)
                          o[i+1].click(o[i+1]);
                        else
                          o[i].click(o[i]);
                        }
        this.movePre=function ()
                       {var o=document.getElementsByTagName("SPAN");
                        var l=o.length;
                        if(this.O==null)
                          {o[0].click(o[0]);  
                           return true;
                          }
                        for(var i=0;i<l;i++)
                          if(o[i].className==this.O.className)
                            break;
                        if(i<l && i>0)
                          {var oP=o[i-1].parentElement;
                           var oC=null;
                           while(oP!=document.body)
                             {if(oP.tagName=="TR" && oP.style.display=="none")
                                {oP.style.display="";
                                 oP.previousSibling.firstChild.firstChild.firstChild.src="comm/img/tree/unwrap.gif";
                                 oP.previousSibling.firstChild.firstChild.type="open";
                                }
                              oP=oP.parentElement;
                             }
                           o[i-1].click(o[i-1]);
                          }
                        else
                          o[0].click(o[0]);
                       }
        this.reLoad=function ()
                      {var o=document.getElementsByTagName("SPAN");
                       var l=o.length;
                       if(this.O==null)
                         {o[0].click(o[0]);  
                          return true;
                         }
                       for(var i=0;i<l;i++)
                         if(o[i].className==this.O.className)
                           break;
                       if(i<l)
                         o[i].click(o[i]);
                       else
                         o[0].click(o[0]);
                      }
        this.show=function ()
                    {document.writeln(this.style);
                     document.writeln(this.tree);
                     document.writeln("<a id='tmpA'></a>");
                    }
       }
      var s=new eyunTree("s")
      var n=s.addNode("root","testRoot1",1)
      var a=s.addNode(n,"testNode1",1)
      s.addNode(a,"testNodeChild1",0,"http://www.iecn.net","_blank")
      s.addNode(a,"testNodeChild2",0,"http://www.iecn.net","_blank")
      var t=s.addNode(a,"testNodeChildNode1",1)
      s.addNode(t,"testNodeChild1",0,"http://www.iecn.net","_blank")
      s.addNode(t,"testNodeChild2",0,"http://www.iecn.net","_blank")
      s.addNode(n,"testChild2",0,"http://www.iecn.net","_blank")
      s.addNode(n,"testChild3",0,"http://www.chinaddv.com","_blank")
      var o=s.addNode("root","testRoot2",1)
      s.addNode(o,"testChild1",0,"http://www.chinaddv.com","_blank")
      d=s.addNode(o,"testChild2",1)
      s.addNode(d,"testChild1",0,"http://www.chinaddv.com","_blank")
      e=s.addNode(d,"testChild1",1)
      s.addNode(e,"testChild1",0,"http://www.chinaddv.com","_blank")
      s.addNode(e,"testChild1",0,"http://www.chinaddv.com","_blank")
      s.addNode(e,"testChild1",0,"http://www.chinaddv.com","_blank")
      s.addNode(d,"testChild1",0,"http://www.chinaddv.com","_blank")
      s.addNode(o,"testChild3",0,"http://www.chinaddv.com","_blank")
      s.show();
    </script>

    posted on 2007-10-09 09:53 lk 閱讀(2467) 評論(0)  編輯  收藏 所屬分類: ajax&js
    主站蜘蛛池模板: 亚洲国产精品第一区二区| a级黄色毛片免费播放视频| 国产av无码专区亚洲av桃花庵| 一本无码人妻在中文字幕免费| 久久国产精品免费一区| 在线观看亚洲精品专区| 久久久久se色偷偷亚洲精品av| 亚洲精品少妇30p| 午夜亚洲国产成人不卡在线| 成人免费看黄20分钟| 99久久免费国产香蕉麻豆| 久久精品免费观看国产| 亚洲国产精品一区二区第四页 | 又爽又高潮的BB视频免费看| 国产精品入口麻豆免费观看| 国产午夜精品久久久久免费视| 人成午夜免费大片在线观看| 国产精品亚洲精品爽爽| 亚洲人成未满十八禁网站| 日本亚洲色大成网站www久久| 久久亚洲日韩看片无码| 亚洲精选在线观看| 亚洲成av人在线视| 国产亚洲精品va在线| 亚洲婷婷五月综合狠狠爱| 亚洲一级特黄无码片| 久久久久久久亚洲精品| 亚洲男人av香蕉爽爽爽爽| 亚洲综合另类小说色区色噜噜| 亚洲AⅤ永久无码精品AA| 免费国产一级特黄久久| 国产jizzjizz视频全部免费| 日美韩电影免费看| 免费一级一片一毛片| 亚洲精品国产成人影院| MM131亚洲国产美女久久| 综合久久久久久中文字幕亚洲国产国产综合一区首 | 国产精品无码免费专区午夜| 亚洲精品偷拍视频免费观看| 久久国产一片免费观看| 永久免费不卡在线观看黄网站|