?? tree.js
字號:
//樹類
//=====================================================================
function Tree(name, objectname){
var rootnode = new Node();
rootnode.name = name;
rootnode.tree = this;
rootnode.displaychild = true;
rootnode.zhankaiguo = true;
this.treename = name ; //名稱
this.maxlevel = 0; //最大級別
this.root = rootnode; //這是根節點 ,是樹的數據結構第一種形式
this.treeArray=[]; //這是樹對應的一個簡單的數組,為了快速訪問樹
//用客戶端的空間換取時間,是樹的數據結構第二種形式,根節點
//下標為0;
this.treeArray[0] = this.root;
this.current = 0;
this.tempString = ''; //存放顯示樹字符串的地方
this.objectname = objectname;
this.clickbyhand = true;
this.divtree;
}
Tree.prototype.add = function (node){
this.root.add(node);
}
Tree.prototype.toString = function (){
//alert('進入方法內部');
this.tempString = '';
this.rootnode.display();
return this.tempString;
};
?? 快捷鍵說明
復制代碼
Ctrl + C
搜索代碼
Ctrl + F
全屏模式
F11
切換主題
Ctrl + Shift + D
顯示快捷鍵
?
增大字號
Ctrl + =
減小字號
Ctrl + -