人人做人人澡人人爽欧美,国产主播一区二区,久久久精品五月天,羞羞视频在线观看免费

當(dāng)前位置:蘿卜系統(tǒng)下載站 > 技術(shù)開發(fā)教程 > 詳細(xì)頁面

樹型菜單-用JS編寫

樹型菜單-用JS編寫

更新時(shí)間:2022-08-08 文章作者:未知 信息來源:網(wǎng)絡(luò) 閱讀次數(shù):


這個(gè)樹型菜單的代碼簡單一點(diǎn)。
<script language="JavaScript">
NS4 = (document.layers) ? 1 : 0;
IE4 = (document.all) ? 1 : 0;
ver4 = (NS4
IE4) ? 1 : 0;

if (ver4) {
with (document) {
write("<STYLE TYPE='text/css'>");
if (NS4) {
write(".parent {position:absolute; visibility:visible}");
write(".child {position:absolute; visibility:visible}");
write(".regular {position:absolute; visibility:visible}")
}
else {
write(".child {display:none}")
}
write("</STYLE>");
}
}

function getIndex(el) {
ind = null;
for (i=0; i<document.layers.length; 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<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");
for (i=0; i<divColl.length; i++) {
whichEl = divColl(i);
if (whichEl.className == "child") whichEl.style.display = "none";
}
}
}

function expandIt(el) {
if (!ver4) return;
if (IE4) {
whichEl = eval(el + "Child");
if (whichEl.style.display == "none") {
whichEl.style.display = "block";
}
else {
whichEl.style.display = "none";
}
}
else {
whichEl = eval("document." + el + "Child");
if (whichEl.visibility == "hide") {
whichEl.visibility = "show";
}
else {
whichEl.visibility = "hide";
}
arrange();
}
}
onload = initIt;
</script>
</font></p>
<div id="KB1Parent" class="parent"><a href="#" onClick="expandIt('KB1'); return false" ><img

src="http://www.okasp.com/techinfo/img/plus.gif" border=0>文件夾一</a></div>
<div id="KB1Child" class="child"><a href="sample.htm" target="_blank" ><img

src="http://www.okasp.com/techinfo/img/spacer.gif" border=0 alt='樹型菜單-用JS編寫'><img src="http://www.okasp.com/techinfo/img/open.gif" border=0>頁面一</a><br>
<a href="sample.htm" target="_blank" ><img src="http://www.okasp.com/techinfo/img/spacer.gif" border=0 alt='樹型菜單-用JS編寫' width="15"

height="11"><img src="http://www.okasp.com/techinfo/img/open.gif" border=0>頁面二</a><br>
<a href="sample.htm" target="_blank" ><img src="http://www.okasp.com/techinfo/img/spacer.gif" border=0 alt='樹型菜單-用JS編寫' width="15"

height="11"><img src="http://www.okasp.com/techinfo/img/open.gif" border=0>頁面三</a></div>
<div id="KB2Parent" class="parent"><a href="#" onClick="expandIt('KB2'); return false" ><img

src="http://www.okasp.com/techinfo/img/plus.gif" border=0>文件夾二</a></div>
<div id="KB2Child" class="child"><a href="sample.htm" target="_blank" ><img

src="http://www.okasp.com/techinfo/img/spacer.gif" border=0 alt='樹型菜單-用JS編寫' width="15" height="11"><img src="http://www.okasp.com/techinfo/img/open.gif" border=0>頁面一</a><br>
<a href="sample.htm" target="_blank" ><img src="http://www.okasp.com/techinfo/img/spacer.gif" border=0 alt='樹型菜單-用JS編寫'><img

src="http://www.okasp.com/techinfo/img/open.gif" border=0>頁面二</a><br>
<a href="sample.htm" target="_blank" ><img src="http://www.okasp.com/techinfo/img/spacer.gif" border=0 alt='樹型菜單-用JS編寫' width="15"

height="11"><img src="http://www.okasp.com/techinfo/img/open.gif" border=0>頁面三</a></div>
<div id="KB3Parent" class="parent"><a href="#" onClick="expandIt('KB3'); return false" ><img

src="http://www.okasp.com/techinfo/img/plus.gif" border=0>文件夾三</a></div>
<div id="KB3Child" class="child"> <a href="sample.htm" target="_blank" ><img

src="http://www.okasp.com/techinfo/img/spacer.gif" border=0 alt='樹型菜單-用JS編寫'><img src="http://www.okasp.com/techinfo/img/open.gif" border=0>頁面一</a><br>
<a href="sample.htm" target="_blank" ><img src="http://www.okasp.com/techinfo/img/open.gif" border=0>頁面二</a><br>
<a href="sample.htm" target="_blank" ><img src="http://www.okasp.com/techinfo/img/spacer.gif" border=0 alt='樹型菜單-用JS編寫'><img

src="http://www.okasp.com/techinfo/img/open.gif" border=0>頁面三</a></div>
<script language="JavaScript">
if (NS4) {
firstEl = "KB1Parent";
firstInd = getIndex(firstEl);
arrange();
}
</script>

溫馨提示:喜歡本站的話,請收藏一下本站!

本類教程下載

系統(tǒng)下載排行

網(wǎng)站地圖xml | 網(wǎng)站地圖html
主站蜘蛛池模板: 钦州市| 台北县| 肥乡县| 祥云县| 句容市| 项城市| 修武县| 新兴县| 铅山县| 太原市| 滦南县| 易门县| 彭州市| 苍梧县| 永新县| 花莲市| 上杭县| 安吉县| 华宁县| 临夏县| 登封市| 黔西县| 保定市| 津市市| 丘北县| 游戏| 建德市| 新余市| 漠河县| 鱼台县| 丘北县| 平塘县| 清丰县| 新沂市| 双鸭山市| 慈溪市| 东乡族自治县| 土默特右旗| 治县。| 奉贤区| 天柱县|