JAVA & XML & JAVASCRIPT & AJAX & CSS

          Web 2.0 技術(shù)儲(chǔ)備............

            BlogJava :: 首頁 :: 新隨筆 :: 聯(lián)系 :: 聚合  :: 管理 ::
            77 隨筆 :: 17 文章 :: 116 評論 :: 0 Trackbacks

          1."CNL Tree Menu"為無限級(jí)樹形,兼容以下版本的瀏覽器:IE5.0+, FF1.06+, Opera8.5+ ……
          2.HTML,CSS,JavaScript代碼相互分離(即數(shù)據(jù),風(fēng)格,腳本三者分離),可應(yīng)用于多種場合,易于維護(hù)3.修改;更換樹形圖標(biāo),只需要修改CSS文件.
          4.通過W3C校驗(yàn)(XHtml1-Strict,CSS1.0).
          5.最后更新:2006-2-13
          6.演示地址:http://cnlei.iecn.net/mycode/CNLTreeMenu/Ver1.0.2/index.html
          7.下載地址:http://cnlei.iecn.net/mycode/CNLTreeMenu/CNLTreeMenuVer1.0.2.rar

          實(shí)例演示:

          CNL Tree Menu Ver1.02
          Author:CNLei,楓巖
          MySitewww.cnlei.net, cnlei.iecn.net
          E-Mail:cnlei.y.l#gail.com (請將#換成@)
          Intro
          1. "CNL Tree Menu"為無限級(jí)樹形,兼容以下版本的瀏覽器:IE5.0+, FF1.06+, Opera8.5+ ……
          2. HTML,CSS,JavaScript代碼相互分離(即數(shù)據(jù),風(fēng)格,腳本三者分離),可應(yīng)用于多種場合,易于維護(hù)修改;更換樹形圖標(biāo),只需要修改CSS文件.
          3. 通過W3C校驗(yàn)(XHtml1-Strict,CSS1.0).
          4. 最后更新:2006-2-13
          5. 下載地址:點(diǎn)擊下載
          CSS Code:
          .CNLTreeMenu img.s {cursor:pointer;vertical-align:middle;}
          .CNLTreeMenu ul {padding:0;}
          .CNLTreeMenu li {list-style:none;padding:0;}
          .Closed ul {display:none;}
          .Child img.s {background:none;cursor:default;}
          #CNLTreeMenu1 ul {margin:0 0 0 17px;}
          #CNLTreeMenu1 img.s {width:20px;height:15px;}
          #CNLTreeMenu1 .Opened img.s {background:url(skin1/opened.gif) no-repeat 0 0;}
          #CNLTreeMenu1 .Closed img.s {background:url(skin1/closed.gif) no-repeat 0 0;}
          #CNLTreeMenu1 .Child img.s {background:url(skin1/child.gif) no-repeat 3px 5px;}
          #CNLTreeMenu2 ul {margin:0 0 0 17px;}
          #CNLTreeMenu2 img.s {width:17px;height:15px;}
          #CNLTreeMenu2 .Opened img.s {background:url(skin2/opened.gif) no-repeat 4px 6px;}
          #CNLTreeMenu2 .Closed img.s {background:url(skin2/closed.gif) no-repeat 3px 6px;}
          #CNLTreeMenu2 .Child img.s {background:url(skin2/child.gif) no-repeat 3px 5px;}
          #CNLTreeMenu3 ul {margin:0 0 0 17px;}
          #CNLTreeMenu3 img.s {width:34px;height:18px;}
          #CNLTreeMenu3 .Opened img.s {background:url(skin3/opened.gif) no-repeat 0 1px;}
          #CNLTreeMenu3 .Closed img.s {background:url(skin3/closed.gif) no-repeat 0 1px;}
          #CNLTreeMenu3 .Child img.s {background:url(skin3/child.gif) no-repeat 13px 2px;}
          
          JavaScript Code:
          /*****************************
          JavaScript Code for CNLTreeMenu
          Version: Ver 1.02
          Author : CNLei, 楓巖
          E-Mail : CNLei.Y.L@gmail.com
          MySite : http://www.cnlei.net
          Passed : XHtml 1.0, CSS 2.0, IE5.0+, FF1.0+, Opera8.5+
          Update : 2006-2-12
          *****************************/
          function Ob(o){
           var o=document.getElementById(o)?document.getElementById(o):o;
           return o;
          }
          function Hd(o) {
           Ob(o).style.display="none";
          }
          function Sw(o) {
           Ob(o).style.display="";
          }
          function ExCls(o,a,b,n){
           var o=Ob(o);
           for(i=0;i<n;i++) {o=o.parentNode;}
           o.className=o.className==a?b:a;
          }
          function CNLTreeMenu(id,TagName0) {
            this.id=id;
            this.TagName0=TagName0==""?"li":TagName0;
            this.AllNodes = Ob(this.id).getElementsByTagName(TagName0);
            this.InitCss = function (ClassName0,ClassName1,ClassName2,ImgUrl) {
            this.ClassName0=ClassName0;
            this.ClassName1=ClassName1;
            this.ClassName2=ClassName2;
            this.ImgUrl=ImgUrl || "css/s.gif";
            this.ImgBlankA ="<img src=\"css/s.gif\" class=\"s\" onclick=\"ExCls(this,'"+ClassName0+"','"+ClassName1+"',1);\" alt=\"展開/折疊\" />";
            this.ImgBlankB ="<img src=\"css/s.gif\" class=\"s\" />";
            for (i=0;i<this.AllNodes.length;i++ ) {
             this.AllNodes[i].className==""?this.AllNodes[i].className=ClassName1:"";
             this.AllNodes[i].innerHTML=(this.AllNodes[i].className==ClassName2?this.ImgBlankB:this.ImgBlankA)+this.AllNodes[i].innerHTML;
             }
           }
           this.SetNodes = function (n) {
            var sClsName=n==0?this.ClassName0:this.ClassName1;
            for (i=0;i<this.AllNodes.length;i++ ) {
             this.AllNodes[i].className==this.ClassName2?"":this.AllNodes[i].className=sClsName;
            }
           }
          }
          
          posted on 2006-03-20 09:34 Web 2.0 技術(shù)資源 閱讀(1649) 評論(1)  編輯  收藏 所屬分類: Javascript

          評論

          # re: CNL Tree Menu 無限級(jí)CSS樹形菜單 兼容各瀏覽器 [轉(zhuǎn)][未登錄] 2008-10-07 11:28 aaa
          怎樣單獨(dú)打開一層  回復(fù)  更多評論
            

          主站蜘蛛池模板: 建始县| 千阳县| 板桥市| 鹿泉市| 连平县| 团风县| 梅州市| 隆德县| 呼玛县| 济宁市| 内黄县| 鄂托克前旗| 甘肃省| 安吉县| 金坛市| 兰坪| 贵港市| 巢湖市| 高陵县| 台州市| 都江堰市| 抚宁县| 光泽县| 武定县| 五指山市| 浮山县| 金坛市| 青阳县| 夹江县| 佛学| 汉源县| 顺义区| 阜平县| 余干县| 登封市| 泰宁县| 正定县| 陇西县| 京山县| 大足县| 丽水市|