本原码从网上下载,经本人改写,功能更强大,使用更方便,可以有无限级目录,一次性载入,可以分别设置树结点和叶结点的颜色及图标,可以展开和收缩,可以显示当前所处的路径位置,点击树结点时只在展开时显示树结点的超链接,不过,据测试,一次性载入500个节点时浏览器会显示“该脚本会使浏览器变慢”的提示,不过,选择不取消执行不会影响浏览器的性能。
function folder(folderdescription, hreference,parentid,target) {
//constant data;
this.desc = folderdescription;
this.parentid=parentid;
this.hreference = hreference;
this.target=target;
this.id = index;
this.navobj = 0;
this.iconimg = 0;
this.nodeimg = 0;
this.islastnode = 0;
// dynamic data
this.isroot = true;
this.isopen = true;
this.iconsrc=../../imageurl+"ftv2folderopen.gif";
this.iconroot =imageurl+"ftv2folderopen.gif";
this.children = new array;
this.nchildren = 0;
// methods
this.initialize = initializefolder;
this.setstate = setstatefolder;
this.addchild = addchild;
this.createindex = createentryindex;
this.hide = hidefolder;
this.display = display;
this.renderob = drawfolder;
this.totalheight = totalheight;
this.subentries = foldersubentries;
this.outputlink = outputfolderlink;
}
function setstatefolder(isopen) {
var subentries;
var totalheight;
var fit = 0;
var i = 0;
if(isopen == this.isopen)
return;
if(browserversi
| 对此文章发表了评论 |
