⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 tree.js

📁 一个采用HIBERNET
💻 JS
字号:
NS4 = (document.layers) ? 1 : 0;
IE4 = (document.all) ? 1 : 0;
ver4 = (NS4 || IE4) ? 1 : 0;

function expandIt(index)
{
	var menuitem=new Array()
	menuitem[1]=questionChild
	menuitem[2]=studentChild

	//对id=树的父节点进行操作
	if (menuitem[index].style.display=="block")
	{
		displayall()
	}
	else 
	{
		displayall()
		menuitem[index].style.display="block"
	}
}

function displayall()
{

	questionChild.style .display ="none"
	studentChild.style .display ="none"
}
function arrange() 
{
    nextY = document.layers[firstInd].pageY +document.layers[firstInd].document.height;
    for (i=firstInd+1; i<document.layers.length; i++)
	{
        whichEl = document.layers[i];
        if (whichEl.visibility != "hide") 
		{
            whichEl.pageY = nextY;
            nextY += whichEl.document.height;
		}
    }
}
function initIt()
{
    if (!ver4) return;
    if (NS4) 
	{
        for (i=0; i<document.layers.length; i++) 
		{
            whichEl = document.layers[i];
            if (whichEl.id.indexOf("Child") != -1) whichEl.visibility = "hide";
		}
        arrange();
    }
    else 
	{
        divColl = document.all.tags("DIV");//在IE下找到“DIV”tag,然后对className = “child”的tag进行操作
        for (i=0; i<divColl.length; i++) 
		{
            whichEl = divColl(i);
            if (whichEl.className == "child") whichEl.style.display = "none";
        }
    }
}
onload = initIt;//初始化使“树”处于“合”的状态

⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -