繁体中文
设为首页
加入收藏
当前位置:ASP技术首页 >> ASP基础 >> 我搜集过一段类似的js,不知道有用否

我搜集过一段类似的js,不知道有用否

2006-06-15 08:00:00  作者:  来源:互联网  浏览次数:0  文字大小:【】【】【
简介:脚本说明: 第一步:把如下代码加入区域中 第二步:把如下代码加入区域中 展开/关闭全部 主菜单一 连接页面1 连接页面2 连接页面3 连接页面4 主菜单二 连接页面1 连接页面2 连...
关键字:似的 有用

脚本说明:

第一步:把如下代码加入区域中

第二步:把如下代码加入区域中


t-plus.gif" WIDTH=9 HEIGHT=9 BORDER=0 ALT="展开或关闭全部菜单">展开/关闭全部


rsment.js

isExpanded = false;

function getIndex(el) {

ind = null;

for (i=0; i

whichEl = document.layers[i];

if (whichEl.id == el) {

ind = i;

break;

}

}

return ind;

}

function arrange() {

nextY = document.layers[firstInd].pageY + document.layers[firstInd].document.

height;

for (i=firstInd+1; i

whichEl = document.layers[i];

if (whichEl.visibility != "hide") {

whichEl.pageY = nextY;

nextY += whichEl.document.height;

}

}

}

function initIt(){

if (NS4) {

for (i=0; i

whichEl = document.layers[i];

if (whichEl.id.indexOf("Child") != -1) whichEl.visibility = "hide";

}

arrange();

}

else {

tempColl = document.all.tags("DIV");

for (i=0; i

if (tempColl(i).className == "child") tempColl(i).style.display = "none";

}

}

}

function expandIt(el) {

if (!ver4) return;

if (IE4) {expandIE(el)} else {expandNS(el)}

}

function expandIE(el) {

whichEl = eval(el + "Child");

whichIm = event.srcElement;

if (whichEl.style.display == "none") {

whichEl.style.display = "block";

whichIm.src = "bullet-minus.gif";

}

else {

whichEl.style.display = "none";

whichIm.src = "bullet-plus.gif";

}

}

function expandNS(el) {

whichEl = eval("document." + el + "Child");

whichIm = eval("document." + el + "Parent.document.images['imEx']");

if (whichEl.visibility == "hide") {

whichEl.visibility = "show";

whichIm.src = "bullet-minus.gif";

}

else {

whichEl.visibility = "hide";

whichIm.src = "bullet-plus.gif";

}

arrange();

}

function showAll() {

for (i=firstInd; i

whichEl = document.layers[i];

whichEl.visibility = "show";

}

}

function expandAll(isBot) {

newSrc = (isExpanded) ? "bullet-plus.gif" : "bullet-minus.gif";

if (NS4) {

document.images["imEx"].src = newSrc;

for (i=firstInd; i

whichEl = document.layers[i];

if (whichEl.id.indexOf("Parent") != -1) {

whichEl.document.images["imEx"].src = newSrc;

}

if (whichEl.id.indexOf("Child") != -1) {

whichEl.visibility = (isExpanded) ? "hide" : "show";

}

}

arrange();

if (isBot && isExpanded) scrollTo(0,document.layers[firstInd].pageY);

}

else {

divColl = document.all.tags("DIV");

for (i=0; i

if (divColl(i).className == "child") {

divColl(i).style.display = (isExpanded) ? "none" : "block";

}

}

imColl = document.images.item("imEx");

for (i=0; i

imColl(i).src = newSrc;

}

}

isExpanded = !isExpanded;

}

with (document) {

write("");

}

onload = initIt;

责任编辑:admin
相关文章