以下是引用chenjin145在2006-10-9 10:54:14的发言:
需要看你那個js文件是如何給出接口的 在如何掉用
哦,这些是用的到的代码
function Folder(folderDescription, hreference) //constructor
{
//constant data
descTemp_arr = folderDescription .split("|");
this.desc=descTemp_arr[0] ;//strRemoveHtml(descTemp_arr[0]);
// 获取节点类型,Modify by YCJ
if( descTemp_arr[1] == null ) {
this.folderType = "ftv2Gen"; //default type is iGen
} else {
this.folderType = descTemp_arr[1];
}
//Assign folder default icon,Modify by YCJ
if( descTemp_arr[2] == null ) {
this.iconSrc = "../images/" + this.folderType + "Folder.gif" ;
} else {
this.iconSrc = descTemp_arr[2];
}
//Assign folder open icon,modify by YCJ
if( descTemp_arr[3] == null ) {
Temp_arr1 = this.iconSrc .split(".");
this.iconSrcOpen = Temp_arr1[0] + "Open.gif" ;
} else {
this.iconSrcOpen = descTemp_arr[3];
}
//this.desc = folderDescription
this.hreference = hreference
this.id = -1
this.navObj = 0
this.iconImg = 0
this.nodeImg = 0
this.isLastNode = 0
//dynamic data
this.isOpen = true
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 insFld(parentFolder, childFolder)
{
return parentFolder.addChild(childFolder)
}
function gFld(description, hreference)
{
folder = new Folder(description, hreference)
return folder
}
function initializeDocument()
{
if (doc.all)
browserVersion = 1 //IE4
else
if (doc.layers)
browserVersion = 2 //NS4
else
browserVersion = 0 //other
foldersTree.initialize(0, 1, "")
foldersTree.display()
if (browserVersion > 0)
{
doc.write("<layer top="+indexOfEntries[nEntries-1].navObj.top+"> </layer>")
// close the whole tree
clickOnNode(0)
// open the root folder
clickOnNode(0)
}
}