极乐净土的舞蹈视频:谁能帮我解释一下下面的程序

来源:百度文库 编辑:神马品牌网 时间:2024/04/28 03:47:54
function Node(id, pid, name, icon, iconOpen, open) {
this.id = id;
this.pid = pid;
this.name = name;
this.icon = icon;
this.iconOpen = iconOpen;
this._io = open || false;
this._is = false;
this._ls = false;
this._hc = false;
this._ai = 0;
this._p;
};
function dTree(objName) {
this.config = {
folderLinks: true,
useSelection: true,
useCookies: true,
useLines: true,
useIcons: true,
useStatusText: false,
closeSameLevel: false,
inOrder: false
}
this.icon = {
root: 'img/base.gif',
folder: 'img/folder.gif',
folderOpen: 'img/folderopen.gif',
empty: 'img/empty.gif',
node: 'img/page.gif',
line: 'img/line.gif',
join: 'img/join.gif',
joinBottom: 'img/joinbottom.gif',
plus: 'img/plus.gif',
plusBottom: 'img/plusbottom.gif',
minus: 'img/minus.gif',
minusBottom: 'img/minusbottom.gif',
nlPlus: 'img/nolines_plus.gif',
nlMinus: 'img/nolines_minus.gif'
};
this.obj = objName;
this.aNodes = [];
this.aIndent = [];
this.root = new Node(-1);
this.selectedNode = null;
this.selectedFound = false;
this.completed = false;
};
// 添加一个新的结点到树中
dTree.prototype.add = function(id, pid, name, open) {
this.aNodes[this.aNodes.length] = new Node(id, pid, name, open);
};
// 在网页上显示树
dTree.prototype.toString = function() {
var str = '<div class="dtree">\n';
if (document.getElementById) {
if (this.config.useCookies) this.selectedNode = this.getSelected();
str += this.addNode(this.root);
} else str += 'Browser not supported.';
str += '</div>';
if (!this.selectedFound) this.selectedNode = null;
this.completed = true;
return str;
};
//创建树的结构
dTree.prototype.addNode = function(pNode) {
var str = '';
var n=0;
if (this.config.inOrder) n = pNode._ai;
for (n; n<this.aNodes.length; n++) {
if (this.aNodes[n].pid == pNode.id) {
var cn = this.aNodes[n];
cn._p = pNode;
cn._ai = n;
this.setCS(cn);
if (cn._hc && !cn._io && this.config.useCookies) cn._io = this.isOpen(cn.id);
if (!this.config.folderLinks && cn._hc) cn.url = null;
if (this.config.useSelection && cn.id == this.selectedNode && !this.selectedFound) {
cn._is = true;
this.selectedNode = n;
dTree.prototype.addNode是怎样被执行的

不错的代码,找了好久了,收藏。谢了!