小弟又有一事不明,特来请教!希望高手不要嫌烦!问题简单!

lizhennehzil 2004-10-12 05:27:18
题目是这样的:
制作一个伸展式选单,当选择搜索引擎字样的时候,自动展开子项目;再次选择时,将子项目关闭。
我的程序如下
<script>
var blnzhankai=true;

openmenu(blnzhankai);
function openmenu(){
var strtmp;
var strjj;
strjj=(blnzhankai==true)?"-":"+";
strtmp="<font style='cursor:hand' onmouseover='mover(this)' onmouseout='mout(this)' onclick='openmenu()'>"+strjj+"搜索引擎</font><BR>";
document.write (strtmp);
if (blnzhankai==true)
{
strtmp="<font style='cursor:hand' onmouseover='mover(this)' onmouseout='mout(this)'><LI>我的网站</font><BR>";
document.write (strtmp);
strtmp="<font style='cursor:hand' onmouseover='mover(this)' onmouseout='mout(this)'><LI>我的网站1</font><BR>";
document.write (strtmp);
}
blnzhankai=! blnzhankai;
}

function mover(obj){
obj.color='red';
obj.size=6;
}
function mout(obj){
obj.color='black';
obj.size=3;
}
</script>

目前可以实现的效果是,打开后,第一次可以,点击后,只出现“搜索引擎”,但是这个时候就不能再点击了。我不知道为什么!
...全文
71 2 打赏 收藏 转发到动态 举报
写回复
用AI写文章
2 条回复
切换为时间正序
请发表友善的回复…
发表回复
zzsdream 2004-10-13
  • 打赏
  • 举报
回复
这样的代码多的很啊
给你一个参考

<html>
<head>
<title>管理菜单</title>
<meta http-equiv="Content-Type" content="text/html; charset=gb2312">
<style type='text/css'><!--body { margin-top: 0px;}
td { font-size: 9pt; color: #666666;}
a:visited { font-size: 9pt;color: #666666;text-decoration: none;}
a:link { font-size: 9pt; color: #666666; text-decoration: none;}
a:hover { font-size: 9pt;color: #333333; text-decoration: underline;}
.ttt { line-height: 18px;}--></style>
<style type="text/css">
<!--
body {
margin-top: 2px;
margin-left: 0px;
}
td {
font-size: 9pt;
color: #333333;
}
.unnamed1 {
cursor: hand;
}
a:visited {
font-size: 9pt;
color: #333333;
text-decoration: none;
}
a:link {
font-size: 9pt;
color: #333333;
text-decoration: none;
}
a:hover {
font-size: 9pt;
color: red;
text-decoration: underline;
}
-->
</style></head>
<script>
function sm(sname,mname){
if(sname.style.display=='none'){
sname.style.display='';
mname.src='img/admin2.gif';
}else{
sname.style.display='none';
mname.src='img/admin1.gif';
}
}
</script>
<body onselectstart="return false">
<table width="130" border="0" cellpadding="0" cellspacing="1">
<tr>
<td height="22" bgcolor="#D5D5D5" class="unnamed1" onClick="sm(t1,i1);"><table width="100%" border="0" cellspacing="0" cellpadding="0">
<tr>
<td width="20%" align="center"><strong><img id=i1 src="img/admin2.gif" width="14" height="15"></strong></td>
<td width="80%"><strong>网站管理中心</strong></td>
</tr>
</table></td>
</tr>
<tr id='t1'>
<td height="22"><table width="100%" border="0" cellspacing="0" cellpadding="0">
<tr>
<td height="22" align="center"><img src="img/admin3.gif" width="9" height="9"></td>
<td height="22"><a href="admin_company.asp" target="main">公司简介管理</a></td>
</tr>
<tr>
<td height="22" align="center"><img src="img/admin3.gif" width="9" height="9"></td>
<td height="22"><a href="admin_service.asp" target="main">服务指南管理</a></td>
</tr>
<tr>
<td height="22" align="center"><img src="img/admin3.gif" width="9" height="9"></td>
<td height="22"><a href="admin_gonggao.asp" target="main">最新公告管理</a></td>
</tr>
<tr>
<td height="22" align="center"><img src="img/admin3.gif" width="9" height="9"></td>
<td height="22"><a href="admin_news.asp" target="main">网站新闻管理</a></td>
</tr>
<tr>
<td height="22" align="center"><img src="img/admin3.gif" width="9" height="9"></td>
<td height="22"><a href="admin_jingying.asp" target="main">经营范围管理</a></td>
</tr>
</table></td>
</tr>
<tr>
<td height="22" bgcolor="#D5D5D5" class="unnamed1" onClick="sm(t5,tt5);"><table width="100%" border="0" cellspacing="0" cellpadding="0">
<tr>
<td width="20%" align="center"><strong><strong><img id='tt5' src="img/admin1.gif" width="14" height="15"></strong></strong></td>
<td width="80%"><strong><strong> </strong>快运管理系统</strong></td>
</tr>
</table></td>
</tr>
<tr bgcolor="#FFFFFF" id='t5' >
<td height="22"><table width="100%" border="0" cellspacing="0" cellpadding="0">
<tr>
<td width="12%" height="22" align="center"><img src="img/admin4.gif" width="9" height="9"></td>
<td width="88%" height="22"><a href="order_index.asp" target="main">快件综合管理</a></td>
</tr>
<tr>
<td width="12%" height="22" align="center"><img src="img/admin4.gif" width="9" height="9"></td>
<td width="88%" height="22"><a href="order_operate.asp" target="main">快件查询处理</a></td>
</tr>
<tr>
<td width="12%" height="22" align="center"><img src="img/admin4.gif" width="9" height="9"></td>
<td width="88%" height="22"><a href="order_serach.asp" target="main">出货预报导出</a></td>
</tr>
<tr>
<td width="12%" height="22" align="center"><img src="img/admin4.gif" width="9" height="9"></td>
<td width="88%" height="22"><a href="order_serach.asp" target="main">系统参数设置</a></td>
</tr>
</table></td>
</tr>
<tr>
<td height="22" bgcolor="#D5D5D5" class="unnamed1" onClick="sm(t6,tt6);"><table width="100%" border="0" cellspacing="0" cellpadding="0">
<tr>
<td width="20%" align="center"><strong><img id=tt6 src="img/admin1.gif" width="14" height="15"></strong></td>
<td width="80%"><strong>快运财务系统</strong></td>
</tr>
</table></td>
</tr>

<tr bgcolor="#FFFFFF" id='t6' >
<td height="22"><table width="100%" border="0" cellspacing="0" cellpadding="0">
<% if session("level")>=2 then%>
<tr>
<td height="22" align="center"><img src="img/admin5.gif" width="9" height="9"></td>
<td height="22"></td>
</tr>
<%end if%>
<tr>
<td width="12%" height="22" align="center"><img src="img/admin5.gif" width="9" height="9"></td>
<td width="88%" height="22"></td>
</tr>
</table></td>
</tr>
<tr>
<td height="22" bgcolor="#D5D5D5" class="unnamed1" onClick="sm(t7,tt7);"><table width="100%" border="0" cellspacing="0" cellpadding="0">
<tr>
<td width="20%" align="center"><strong><img id=tt7 src="img/admin1.gif" width="14" height="15"></strong></td>
<td width="80%"><strong>国通客户系统</td>
</tr>
</table></td>
</tr>


<tr bgcolor="#FFFFFF" id='t7' >
<td height="22"><table width="100%" border="0" cellspacing="0" cellpadding="0">

<tr>
<td width="12%" height="22" align="center"><img src="img/admin6.gif" width="9" height="9"></td>
<td width="88%" height="22">客户资源管理</td>
</tr>
<tr>
<td width="12%" height="22" align="center"><img src="img/admin6.gif" width="9" height="9"></td>
<td width="88%" height="22">客户财务管理</td>
</tr>
</table></td>
</tr>

<tr>
<td height="22" bgcolor="#D5D5D5" class="unnamed1" onClick="sm(t12,tt12);">
<table width="100%" border="0" cellspacing="0" cellpadding="0">
<tr>
<td width="20%" align="center"><img id=tt12 src="img/admin1.gif" width="14" height="15"></td>
<td width="80%"><strong>系统管理人员</strong></td>
</tr>
</table></td>
</tr>

<tr bgcolor="#FFFFFF" id='t12' >
<td height="22"><table width="100%" border="0" cellspacing="0" cellpadding="0">
<tr>
<td height="22" align="center"><img src="img/admin6.gif" width="9" height="9"></td>
<td height="22">管理管理员</td>
</tr>
<tr>
<td height="22" align="center"><img src="img/admin6.gif" width="9" height="9"></td>
<td height="22">新加管理员</td>
</tr>
</table></td>
</tr>
</table>
<table width="130" border="0" cellspacing="0" cellpadding="0">
<tr>
<td height="47" align="center" bgcolor="#E6E6E6">程序版本:V1.00<br>
程序制作:张宗山  </td>
</tr>
</table>
</table>
</body>
</html>
lizhennehzil 2004-10-13
  • 打赏
  • 举报
回复
怎么没人回呢!

87,901

社区成员

发帖
与我相关
我的任务
社区描述
Web 开发 JavaScript
社区管理员
  • JavaScript
  • 无·法
加入社区
  • 近7日
  • 近30日
  • 至今
社区公告
暂无公告

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