images/TreeNode.js
(开头部分) 5KB这里只显示每个文件的开头 60 行。登录后可以解锁完整代码。
var currentNode = null;
function TreeNode(text, url, iconOpen, iconOpenHover, iconClosed, iconClosedHover) {
var $ = this;
this.level = 0;
this.children = [];
this.parent = null;
this.status = "CLOSED";
this.ancestor = [];
this.isHover = false;
this.PATH = "../images/tree/";
this.COLLAPSED = this.PATH + "arrow_collapsed.gif";
this.EXPANDED = this.PATH + "arrow_expanded.gif";
this.COLLAPSED_HOVER = this.PATH + "arrow_collapsed_hover.gif";
this.EXPANDED_HOVER = this.PATH + "arrow_expanded_hover.gif";
this.CATEGORYOPEN = this.PATH + (iconOpen ? iconOpen : "folder_open.gif");
this.CATEGORYOPEN_HOVER = this.CATEGORYOPEN;
this.CATEGORYCLOSED = this.PATH + (iconClosed ? iconClosed : "folder_closed.gif");
this.CATEGORYCLOSED_HOVER = this.CATEGORYCLOSED;
this.EMPTY = this.PATH + "empty.gif";
this.container = document.createElement("DIV");
this.content = document.createElement("DIV");
this.indentSpace = document.createElement("SPAN");
this.statusIcon = document.createElement("IMG");
this.node = document.createElement("SPAN");
this.nodeIcon = document.createElement("IMG");
this.label = document.createElement("A");
this.container.appendChild(this.content);
this.content.appendChild(this.indentSpace);
this.content.appendChild(this.statusIcon);
this.content.appendChild(this.node);
this.node.appendChild(this.nodeIcon);
this.node.appendChild(this.label);
this.container.style.display = "block";
this.statusIcon.src = this.COLLAPSED;
this.nodeIcon.src = this.CATEGORYCLOSED;
this.nodeIcon.align = "absmiddle";
this.statusIcon.align = "absmiddle";
this.statusIcon.style.cursor = "default";
this.node.style.cursor = "default";
this.label.style.lineHeight = "20px";
this.label.style.fontSize = "12px";
this.label.style.display = "inline-block";
this.label.style.backgroundImage = "url(" + this.BG + ")";
this.label.style.backgroundRepeat = "repeat-x";
this.label.innerHTML = text;
if (url) {
this.label.href = url;
this.label.target = "hsgmain";
}
this.add = function(child) {
this.container.appendChild(child.container);
this.children.push(child);
child.parent = this;
}
后面还有 122 行代码,购买后查看完整代码
24 小时内免费解锁 3 个项目,之后 1 积分/个。 规则说明
AI 解读
登录后可用,每次 10 积分,解读结果公开显示在下面。
还没有人解读过这个文件。
