温馨提示:代码在线浏览功能只能做为源码浏览参考,不能展示项目的全部,如果想更进一步了解该代码请下载:达达ASP.NET企业信息管理系统
当前文件路径:DaDaEnterprise/Admin/Js/rsmenu.js

1isExpanded = false; 2
3
function getIndex(el) { 4
ind = null; 5
for (i=0; i<document.layers.length; i++) { 6
whichEl = document.layers[i]; 7
if (whichEl.id == el) { 8
ind = i; 9
break; 10
} 11
} 12
return ind; 13
} 14
15
function arrange() { 16
nextY = document.layers[firstInd].pageY + document.layers[firstInd].document.height; 17
for (i=firstInd+1; i<document.layers.length; i++) { 18
whichEl = document.layers[i]; 19
if (whichEl.visibility != "hide") { 20
whichEl.pageY = nextY; 21
nextY += whichEl.document.height; 22
} 23
} 24
} 25
26
function initIt(){ 27
if (NS4) { 28
for (i=0; i<document.layers.length; i++) { 29
whichEl = document.layers[i]; 30
if (whichEl.id.indexOf("Child") != -1) whichEl.visibility = "hide"; 31
} 32
arrange(); 33
} 34
else { 35
tempColl = document.all.tags("DIV"); 36
for (i=0; i<tempColl.length; i++) { 37
if (tempColl(i).className == "child") tempColl(i).style.display = "none"; 38
} 39
} 40
} 41
42
function expandIt(el) { 43
if (!ver4) return; 44
if (IE4) {expandIE(el)} else {expandNS(el)} 45
} 46
47
function expandIE(el) { 48
whichEl = eval(el + "Child"); 49
whichIm = event.srcElement; 50
51
if (whichEl.style.display == "none") { 52
whichEl.style.display = "block"; 53
whichIm.src = "bullet-minus.gif"; 54
} 55
else { 56
whichEl.style.display = "none"; 57
whichIm.src = "bullet-plus.gif"; 58
} 59
} 60
61
function expandNS(el) { 62
whichEl = eval("document." + el + "Child"); 63
whichIm = eval("document." + el + "Parent.document.images['imEx']"); 64
if (whichEl.visibility == "hide") { 65
whichEl.visibility = "show"; 66
whichIm.src = "bullet-minus.gif"; 67
} 68
else { 69
whichEl.visibility = "hide"; 70
whichIm.src = "bullet-plus.gif"; 71
} 72
arrange(); 73
} 74
75
function showAll() { 76
for (i=firstInd; i<document.layers.length; i++) { 77
whichEl = document.layers[i]; 78
whichEl.visibility = "show"; 79
} 80
} 81
82
function expandAll(isBot) { 83
newSrc = (isExpanded) ? "bullet-plus.gif" : "bullet-minus.gif"; 84
85
if (NS4) { 86
document.images["imEx"].src = newSrc; 87
for (i=firstInd; i<document.layers.length; i++) { 88
whichEl = document.layers[i]; 89
if (whichEl.id.indexOf("Parent") != -1) { 90
whichEl.document.images["imEx"].src = newSrc; 91
} 92
if (whichEl.id.indexOf("Child") != -1) { 93
whichEl.visibility = (isExpanded) ? "hide" : "show"; 94
} 95
} 96
97
arrange(); 98
if (isBot && isExpanded) scrollTo(0,document.layers[firstInd].pageY); 99
} 100
else { 101
divColl = document.all.tags("DIV"); 102
for (i=0; i<divColl.length; i++) { 103
if (divColl(i).className == "child") { 104
divColl(i).style.display = (isExpanded) ? "none" : "block"; 105
} 106
} 107
imColl = document.images.item("imEx"); 108
for (i=0; i<imColl.length; i++) { 109
imColl(i).src = newSrc; 110
} 111
} 112
113
isExpanded = !isExpanded; 114
} 115
116
with (document) { 117
write("<STYLE TYPE='text/css'>"); 118
if (NS4) { 119
write(".parent {position:absolute; visibility:hidden}"); 120
write(".child {position:absolute; visibility:hidden}"); 121
write(".regular {position:absolute; visibility:hidden}") 122
} 123
else { 124
write(".child {display:none}") 125
} 126
write("</STYLE>"); 127
} 128
129
onload = initIt; 130
131




ind 
}
}