注册 登录
编程论坛 ASP技术论坛

[求助]这个功能如何实现

白小痴 发布于 2006-07-04 13:55, 1131 次点击
http://www.uaa.cn/左下角社区热帖 周排行 月排行
点击他们,只有它们下面的页面刷新了 如何实现呢?
只有本站会员才能查看附件,请 登录

只有本站会员才能查看附件,请 登录

14 回复
#2
icecool2006-07-04 14:23


与你刚才是相同的问题,同一道理,
隐藏,

[CODE]

<style type=text/css>
td
{
font-size: 12px;
color: #ff0000;
line-height: 150%;
}
.sec1
{
background-color: #eeeeee;
cursor: hand;
color: #000000;
border-left: 1px solid #FFffff;
border-top: 1px solid #FFFFFF;
border-right: 1px solid gray;
border-bottom: 1px solid #eeeeee
}
.sec2
{
background-color: #eeeeee;
cursor: hand;
color: #ff0000;
border-left: 1px solid #FFFFFF;
border-top: 1px solid #FFFFFF;
border-right: 1px solid gray;
font-weight: bold;
}
.main_tab
{
background-color: #eeeeee;
color: #000000;
border-left:1px solid #FFffff;
border-right: 1px solid gray;
border-bottom: 1px solid gray;
}

</style>

<script language=javascript>

function secBoard(n)
{
for(i=0;i<secTable.cells.length;i++)
secTable.cells[i].className="sec1";
secTable.cells[n].className="sec2";

for(i=0;i<mainTable.tBodies.length;i++)
mainTable.tBodies[i].style.display="none";
mainTable.tBodies[n].style.display="block";
}

</script><body bgcolor="#FFFFFF" leftmargin="0" topmargin="0">
<table width=160 border=0 cellpadding=0 cellspacing=0 id=secTable>
<tr height=20 align=center>
<td class=sec2 width=10% onclick="secBoard(0)">图像</td>
<td class=sec1 width=10% onclick="secBoard(1)">档案</td>
<td class=sec1 width=10% onclick="secBoard(2)">统计</td>
</tr>
</table>
<table width=160 height=146 border=0 cellpadding=0 cellspacing=0 class=main_tab
id=mainTable>
<tbody style="display:block;">
<tr>
<td align=center valign=top>
<table width=80% height="100" border="0" cellpadding="0" cellspacing="0" boder=1>
<tr height=5>
<td>&nbsp;</td>
<td>&nbsp;</td>
<td>&nbsp;</td>
</tr>
<tr align="center" valign="middle">
<td height="84" colspan="3"><img src="http://998.it50.net/image/icecool.gif" width="100" height="100"></td>
</tr>
</table>
</td>
</tr>
</tbody>

<tbody style="display:none;">
<tr>
<td align=center valign=top>
<table width=80% height="109" border="0" cellpadding="0" cellspacing="0" boder=1>
<tr height=5>
<td width="25%">&nbsp;</td>
<td width="75%">&nbsp;</td>
</tr>
<tr>
<td><div align="left">昵称</div></td>
<td><div align="left">吃草的狼</div></td>
</tr>
<tr>
<td height="18">Q Q</td>
<td><div align="left">25924833</div></td>
</tr>
<tr>
<td>mail</td>
<td><div align="left">1832306@163.com</div></td>
</tr>
<tr>
<td height="19">主页</td>
<td><div align="left">998.it50.net</div></td>
</tr>
<tr>
<td>&nbsp;</td>
<td>&nbsp;</td>
</tr>
</table></td>
</tr>
</tbody>
<tbody style="display:none;">
<tr>
<td align=center valign=top>
<table width=80% border="0" cellpadding="0" cellspacing="0" boder=1>
<tr height=5>
<td>&nbsp;</td>
<td>&nbsp;</td>
<td>&nbsp;</td>
</tr>
<tr>
<td>第一列</td>
<td>第二列</td>
<td>第三列</td>
</tr>
<tr>
<td>&nbsp;1</td>
<td>&nbsp;2</td>
<td>&nbsp;3</td>
</tr>
<tr>
<td>&nbsp;10</td>
<td>&nbsp;11</td>
<td>&nbsp;12</td>
</tr>
<tr>
<td>&nbsp;21</td>
<td>&nbsp;22</td>
<td>&nbsp;23</td>
</tr>
<tr>
<td>&nbsp;</td>
<td>&nbsp;</td>
<td>&nbsp;</td>
</tr>
</table></td>
</tr>
</tbody>

</table>

[/CODE]
#3
白小痴2006-07-04 14:49

你这个是死的,做好了就不能改了
我想做的是从数据库里读去数据,不过还是要好好谢谢您

#4
hangxj2006-07-04 14:58
只有本站会员才能查看附件,请 登录


icecool 说得对,原理是一样,我把它的下下来了,取出了你想要的部分,自己修改一下就可以用到数据库中了
#5
白小痴2006-07-04 15:14
step_day等未定义  如何定义?
#6
hangxj2006-07-04 15:45
<SCRIPT LANGUAGE="JavaScript">
function loadok()
{
var step_day=document.getElementById("step_day");
var step_week=document.getElementById("step_week");
var step_month=document.getElementById("step_month");

step_day.style.display = "";
step_week.style.display = "none";
step_month.style.display = "none";
}
function dayShow()
{
var step_day=document.getElementById("step_day");
var step_week=document.getElementById("step_week");
var step_month=document.getElementById("step_month");

step_day.style.display = "";
step_week.style.display = "none";
step_month.style.display = "none";
}
function weekShow()
{
var step_day=document.getElementById("step_day");
var step_week=document.getElementById("step_week");
var step_month=document.getElementById("step_month");

step_day.style.display = "none";
step_week.style.display = "";
step_month.style.display = "none";
}
function monthShow()
{
var step_day=document.getElementById("step_day");
var step_week=document.getElementById("step_week");
var step_month=document.getElementById("step_month");

step_day.style.display = "none";
step_week.style.display = "none";
step_month.style.display = "";
}
loadok();
</SCRIPT>

其实我在本地是没有问题的,不过要是你的提示没有定义,你可以这样

[此贴子已经被作者于2006-7-4 15:46:42编辑过]

#7
白小痴2006-07-04 15:56
step_day.style.display = "";
Microsoft JScript 运行时错误: 缺少对象
这次更厉害了 呵呵
#8
hangxj2006-07-04 16:06
请把程序所在错误的行数标出来,谢谢

这个代码其实在我这一开始给你的那个就可以正常运行的,所以希望你把你修改后的代码贴上来,并标出错误所在行,以及错误提示
#9
hangxj2006-07-04 16:11
以下为全部代码

<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8">
<LINK href="style[1].css" type=text/css rel=stylesheet>
<SCRIPT LANGUAGE="JavaScript">
function loadok()
{
step_day.style.display = "";
step_week.style.display = "none";
step_month.style.display = "none";
}
function dayShow()
{
step_day.style.display = "";
step_week.style.display = "none";
step_month.style.display = "none";
}
function weekShow()
{
step_day.style.display = "none";
step_week.style.display = "";
step_month.style.display = "none";
}
function monthShow()
{
step_day.style.display = "none";
step_week.style.display = "none";
step_month.style.display = "";
}
loadok();
</SCRIPT>

</head>
<body>
<table>
<tr>
<td align="right">
<a href="javascript:;" onclick="javascript:dayShow()"><img src="0323_bbs_tu_54.gif" width="74" height="26" border="0"></a>
</td>
<td align="right">
<a href="javascript:;" onclick="javascript:weekShow()"><img src="0323_bbs_tu_55.gif" width="57" height="26" border="0"></a>
</td>
<td align="center">
<a href="javascript:;" onclick="javascript:monthShow()"><img src="0323_bbs_tu_56.gif" width="59" height="26" border="0"></a>
</td>
</tr>
</table>
<span id=step_day>
<table width="226" border="0" cellpadding="0" cellspacing="5" bgcolor="#EED4A3">
<tr>
<td valign="top" bgcolor="#FFFFFF" class="333333_top">
<table width="100%" border="0" align="center" cellpadding="0" cellspacing="0" class="bbs_kuang">
<tr>
<td width="12%" height="20" align="center" bgcolor="#FFFDE6"><img src="index_top_20.gif" width="3" height="5"></td>
<td width="88%" bgcolor="#FFFDE6"><a href="#" target="_blank">我的第一次啊!</a></td>
</tr>
</table>
</td>
</tr>
</table>
</span>
<span id=step_week style="display:none">
<table width="226" border="0" cellpadding="0" cellspacing="5" bgcolor="#EED4A3">
<tr>
<td valign="top" bgcolor="#FFFFFF" class="333333_top">
<table width="100%" border="0" align="center" cellpadding="0" cellspacing="0" class="bbs_kuang">
<tr>
<td width="12%" height="20" align="center" bgcolor="#FFFDE6"><img src="index_top_20.gif" width="3" height="5"></td>
<td width="88%" bgcolor="#FFFDE6"><a href="#" target="_blank">我的第二次啊!</a></td>
</tr>
</table>
</td>
</tr>
</table>
</span>
<span id=step_month style="display:none">

<table width="226" border="0" cellpadding="0" cellspacing="5" bgcolor="#EED4A3">
<tr>
<td valign="top" bgcolor="#FFFFFF" class="333333_top">
<table width="100%" border="0" align="center" cellpadding="0" cellspacing="0" class="bbs_kuang">
<tr>
<td width="12%" height="20" align="center" bgcolor="#FFFDE6"><img src="index_top_20.gif" width="3" height="5"></td>
<td width="88%" bgcolor="#FFFDE6"><a href="#" target="_blank">我的第三次啊!</a></td>
</tr>
</table>
</td>
</tr>
</table>
</span>
</body>
</html>

#10
白小痴2006-07-04 16:12
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8">
<LINK href="style[1].css" type=text/css rel=stylesheet>
<SCRIPT LANGUAGE="JavaScript">
function loadok()
{
var step_day=document.getElementById("step_day");
var step_week=document.getElementById("step_week");
var step_month=document.getElementById("step_month");
step_day.style.display = "";//这里出错
step_week.style.display = "none";
step_month.style.display = "none";
}
function dayShow()
{
var step_day=document.getElementById("step_day");
var step_week=document.getElementById("step_week");
var step_month=document.getElementById("step_month");
step_day.style.display = "";
step_week.style.display = "none";
step_month.style.display = "none";
}
function weekShow()
{
var step_day=document.getElementById("step_day");
var step_week=document.getElementById("step_week");
var step_month=document.getElementById("step_month");
step_day.style.display = "none";
step_week.style.display = "";
step_month.style.display = "none";
}
function monthShow()
{
var step_day=document.getElementById("step_day");
var step_week=document.getElementById("step_week");
var step_month=document.getElementById("step_month");
step_day.style.display = "none";
step_week.style.display = "none";
step_month.style.display = "";
}
loadok();
错误:Microsoft JScript 运行时错误: 缺少对象
我估计下面都是同样的错误
#11
白小痴2006-07-04 16:17
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8">
<LINK href="style[1].css" type=text/css rel=stylesheet>
<SCRIPT LANGUAGE="JavaScript">
function loadok()
{
var step_day=document.getElementById("step_day");
var step_week=document.getElementById("step_week");
var step_month=document.getElementById("step_month");
step_day.style.display = "";
step_week.style.display = "none";
step_month.style.display = "none";
}
function dayShow()
{
var step_day=document.getElementById("step_day");
var step_week=document.getElementById("step_week");
var step_month=document.getElementById("step_month");
step_day.style.display = "";
step_week.style.display = "none";
step_month.style.display = "none";
}
function weekShow()
{
var step_day=document.getElementById("step_day");
var step_week=document.getElementById("step_week");
var step_month=document.getElementById("step_month");
step_day.style.display = "none";
step_week.style.display = "";
step_month.style.display = "none";
}
function monthShow()
{
var step_day=document.getElementById("step_day");
var step_week=document.getElementById("step_week");
var step_month=document.getElementById("step_month");
step_day.style.display = "none";
step_week.style.display = "none";
step_month.style.display = "";
}
loadok();
</SCRIPT>
</head>
<body>
<table><tr>
<td align="right">
<a href="javascript:;" onclick="javascript:dayShow()">
<img src="0323_bbs_tu_54.gif" width="74" height="26" border="0"></a>
</td>
<td align="right">
<a href="javascript:;" onclick="javascript:weekShow()">
<img src="0323_bbs_tu_55.gif" width="57" height="26" border="0"></a>
</td>
<td align="center">
<a href="javascript:;" onclick="javascript:monthShow()">
<img src="0323_bbs_tu_56.gif" width="59" height="26" border="0"></a>
</td>
</tr></table>
<span id=step_day>
<table width="226" border="0" cellpadding="0" cellspacing="5" bgcolor="#EED4A3">
<tr>
<td valign="top" bgcolor="#FFFFFF" class="333333_top">
<table width="100%" border="0" align="center" cellpadding="0" cellspacing="0" class="bbs_kuang">
<tr>
<td width="12%" height="20" align="center" bgcolor="#FFFDE6"><img src="index_top_20.gif" width="3" height="5"></td>
<td width="88%" bgcolor="#FFFDE6"><a href="http://bbs.uaa.cn/viewthread.php?tid=7978" target="_blank">我的第一次啊!</a></td>
</tr>
</table>
</td>
</tr>
</table>
</span>
<span id=step_week style="display:none">
<table width="226" border="0" cellpadding="0" cellspacing="5" bgcolor="#EED4A3">
<tr>
<td valign="top" bgcolor="#FFFFFF" class="333333_top">
<table width="100%" border="0" align="center" cellpadding="0" cellspacing="0" class="bbs_kuang">
<tr>
<td width="12%" height="20" align="center" bgcolor="#FFFDE6"><img src="index_top_20.gif" width="3" height="5"></td>
<td width="88%" bgcolor="#FFFDE6"><a href="http://bbs.uaa.cn/viewthread.php?tid=7978" target="_blank">我的第二次啊!</a></td>
</tr>
</table>
</td>
</tr>
</table>
</span>
<span id=step_month style="display:none">
<table width="226" border="0" cellpadding="0" cellspacing="5" bgcolor="#EED4A3">
<tr>
<td valign="top" bgcolor="#FFFFFF" class="333333_top">
<table width="100%" border="0" align="center" cellpadding="0" cellspacing="0" class="bbs_kuang">
<tr>
<td width="12%" height="20" align="center" bgcolor="#FFFDE6"><img src="index_top_20.gif" width="3" height="5"></td>
<td width="88%" bgcolor="#FFFDE6"><a href="http://bbs.uaa.cn/viewthread.php?tid=7978" target="_blank">我的第三次啊!</a></td>
</tr>
</table>
</td>
</tr>
</table>
</span>
#12
hangxj2006-07-04 16:17
<span id="step_day">

<span id="step_week" style="display:none">

<span id="step_month" style="display:none">

加上引号看看,要是不行那就不好意思帮你不到,因为我这是完全正常的,等其他人来帮你看看吧

[此贴子已经被作者于2006-7-4 16:22:19编辑过]

#13
白小痴2006-07-04 16:21
我这个也应该是完整的啊,为什么就不行呢?
#14
白小痴2006-07-04 16:22
如果我用你的完整的就出现未定义那个错误;
如果加上定义,就出现缺少对象的错误
#15
yue53462006-07-04 22:32
icecool呵呵看了你这些代码,发现原来自己的水平太低了,哈哈~~~以后多发点代码,让我学习,哈哈~~~
1