请问:象本论坛左边这个象浏览器一样的目录导航是怎么做出来的??

showmark 2001-12-01 04:26:56
我现在就要用到这种技术,哪位知道告诉我啊,谢谢了。
...全文
114 7 打赏 收藏 转发到动态 举报
写回复
用AI写文章
7 条回复
切换为时间正序
请发表友善的回复…
发表回复
showmark 2001-12-01
  • 打赏
  • 举报
回复
我一定会回谢你的:)
showmark 2001-12-01
  • 打赏
  • 举报
回复
可是不能运行呀,不知道是哪里有问题
baggio785 2001-12-01
  • 打赏
  • 举报
回复
不要光谢阿,给分啊:)
showmark 2001-12-01
  • 打赏
  • 举报
回复
谢谢你!
baggio785 2001-12-01
  • 打赏
  • 举报
回复
<script language="JavaScript">
NS4=(document.layers) ? true : false;
IE4=(document.all) ? true : false;
ver4=(NS4 || IE4) ? true : false;

if (ver4){
with (document){
write("<STYLE TYPE='text/css'>");
if (NS4){
write(".parent {position:absolute; visibility:visible}");
write(".child {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";
}
}
//expandIt('TREE');
}

function expandIt(el){
if (!ver4) return;
if (IE4) {
var imgObj = document.all("I_" + el);
whichEl = eval(el + "Child");
if (whichEl.style.display == "none") {
whichEl.style.display = "block";
imgObj.src = 'images/shut.gif';
}
else {
whichEl.style.display = "none";
imgObj.src = 'images/expand.gif';
}
}
else {
whichEl = eval("document." + el + "Child");
if (whichEl.visibility == "hide"){
whichEl.visibility = "show";
}
else {
whichEl.visibility = "hide";
}
arrange();
}
}
onload =initIt;
</script>
<META NAME="GENERATOR" Content="Microsoft Visual Studio 6.0">
</HEAD>
<BODY bgcolor=LightSkyBlue>

<div id="TREE0Parent" Class="Parent">
<table border="0" width="100%" cellspacing="3" cellpadding="2">
<tr>
<td width="100%" cellpading="2" bgcolor="#0080FF" class="leftBank" align="left">
<a href="Left.asp#" onClick="expandIt('TREE0'); return false;"><img ID="I_TREE0" border="0" src="images/expand.gif" alt="折叠" WIDTH="11" HEIGHT="11">
<span class="menutitle">a</span></a>
</td>
</tr>
<tr>
<td width="100%" height="6"></td>
</tr>
</table>
</div>
<div id="TREE0Child" Class="Child">

<table border="0" width="100%" cellspacing="0" cellpadding="0">
<tr>
<td width="100%">
<img src="images/list_btn.gif" width="9" height="11">
<a href="a1.asp" target=right><span class="menuitem">a1</span></a></td>

<tr>
<td height="0" width="100%">
</td>
</tr>

</table>
</div>

<div id="TREE1Parent" Class="Parent">
<table border="0" width="100%" cellspacing="3" cellpadding="2">
<tr>
<td width="100%" cellpading="2" bgcolor="#0080FF" class="leftBank" align="left">
<a href="Left.asp#" onClick="expandIt('TREE1'); return false;"><img ID="I_TREE1" border="0" src="images/expand.gif" alt="折叠" WIDTH="11" HEIGHT="11">
<span class="menutitle">b</span></a>
</td>
</tr>
<tr>
<td width="100%" height="6"></td>
</tr>
</table>
</div>
<div id="TREE1Child" Class="Child">

<table border="0" width="100%" cellspacing="0" cellpadding="0">
<tr>
<td width="100%">
<img src="images/list_btn.gif" width="9" height="11">
<A href="b1.asp" target=right><span class="menuitem">b1</span></a></td>

<tr>
<td height="0" width="100%">
</td>
</tr>

</table>

<table border="0" width="100%" cellspacing="0" cellpadding="0">
<tr>
<td width="100%">
<img src="images/list_btn.gif" width="9" height="11">
<A href="b2.asp" target=right><span class="menuitem">b2</span></a></td>

<tr>
<td height="0" width="100%">
</td>
</tr>

</table>
</div>
baggio785 2001-12-01
  • 打赏
  • 举报
回复
<script language="JavaScript">
NS4=(document.layers) ? true : false;
IE4=(document.all) ? true : false;
ver4=(NS4 || IE4) ? true : false;

if (ver4){
with (document){
write("<STYLE TYPE='text/css'>");
if (NS4){
write(".parent {position:absolute; visibility:visible}");
write(".child {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";
}
}
//expandIt('TREE');
}

function expandIt(el){
if (!ver4) return;
if (IE4) {
var imgObj = document.all("I_" + el);
whichEl = eval(el + "Child");
if (whichEl.style.display == "none") {
whichEl.style.display = "block";
imgObj.src = 'images/shut.gif';
}
else {
whichEl.style.display = "none";
imgObj.src = 'images/expand.gif';
}
}
else {
whichEl = eval("document." + el + "Child");
if (whichEl.visibility == "hide"){
whichEl.visibility = "show";
}
else {
whichEl.visibility = "hide";
}
arrange();
}
}
onload =initIt;
</script>
<META NAME="GENERATOR" Content="Microsoft Visual Studio 6.0">
</HEAD>
<BODY bgcolor=LightSkyBlue>

<div id="TREE0Parent" Class="Parent">
<table border="0" width="100%" cellspacing="3" cellpadding="2">
<tr>
<td width="100%" cellpading="2" bgcolor="#0080FF" class="leftBank" align="left">
<a href="Left.asp#" onClick="expandIt('TREE0'); return false;"><img ID="I_TREE0" border="0" src="images/expand.gif" alt="折叠" WIDTH="11" HEIGHT="11">
<span class="menutitle">a</span></a>
</td>
</tr>
<tr>
<td width="100%" height="6"></td>
</tr>
</table>
</div>
<div id="TREE0Child" Class="Child">

<table border="0" width="100%" cellspacing="0" cellpadding="0">
<tr>
<td width="100%">
<img src="images/list_btn.gif" width="9" height="11">
<a href="a1.asp" target=right><span class="menuitem">a1</span></a></td>

<tr>
<td height="0" width="100%">
</td>
</tr>

</table>
</div>

<div id="TREE1Parent" Class="Parent">
<table border="0" width="100%" cellspacing="3" cellpadding="2">
<tr>
<td width="100%" cellpading="2" bgcolor="#0080FF" class="leftBank" align="left">
<a href="Left.asp#" onClick="expandIt('TREE1'); return false;"><img ID="I_TREE1" border="0" src="images/expand.gif" alt="折叠" WIDTH="11" HEIGHT="11">
<span class="menutitle">b</span></a>
</td>
</tr>
<tr>
<td width="100%" height="6"></td>
</tr>
</table>
</div>
<div id="TREE1Child" Class="Child">

<table border="0" width="100%" cellspacing="0" cellpadding="0">
<tr>
<td width="100%">
<img src="images/list_btn.gif" width="9" height="11">
<A href="b1.asp" target=right><span class="menuitem">b1</span></a></td>

<tr>
<td height="0" width="100%">
</td>
</tr>

</table>

<table border="0" width="100%" cellspacing="0" cellpadding="0">
<tr>
<td width="100%">
<img src="images/list_btn.gif" width="9" height="11">
<A href="b2.asp" target=right><span class="menuitem">b2</span></a></td>

<tr>
<td height="0" width="100%">
</td>
</tr>

</table>
</div>
sdliubo 2001-12-01
  • 打赏
  • 举报
回复
好多种方法,用javascript比较简单,找个代码下载看一下吧

28,406

社区成员

发帖
与我相关
我的任务
社区描述
ASP即Active Server Pages,是Microsoft公司开发的服务器端脚本环境。
社区管理员
  • ASP
  • 无·法
加入社区
  • 近7日
  • 近30日
  • 至今
社区公告
暂无公告

试试用AI创作助手写篇文章吧