中国工会会计学会网站:有关onclick="showsubmenu()"

来源:百度文库 编辑:杭州交通信息网 时间:2024/04/26 20:23:48
应该是有关onclick="showsubmenu()"吧

点击一下大栏目,下面的小分类就收缩;再点一下大栏目,下面的小分类就出现
现在在网站中,有11个大类似的大栏目,使用的代码如下:
<td height=25 class=menu_title onmouseover=this.className='menu_title2'; onmouseout=this.className='menu_title'; background="images/admin_left_8.gif" id=menuTitle1 onclick="showsubmenu(7)">
<span>学习中心</span></td>

其中上面六项,了点之后,他不会收缩,IE状态栏提示“网页有错误”
下面5项可以正常伸缩。他们的不同之处就是onclick="showsubmenu()括号中的数字,后五项为8,2,8,12,7

请大家帮忙分析一下,上面的为什么不会伸缩呢?谢谢了!

<table border="0" width="100%" cellspacing="0" cellpadding="0">
<tr>
<td class=menu_title id=menuTitle1
onmouseover="this.className='menu_title2';" onclick=showsubmenu(0)
onmouseout="this.className='menu_title';" width="100%" background="img/left_t.gif" height="23">
<table border="0" width="85%" align="center" cellspacing="5" cellpadding="2">
<tr>
<td width="100%"><font color="#666666"><b>系统管理</b></font></td>
</tr>
</table>
</td>
</tr>
<tr>
<td width="100%" background="img/left_m.gif">
<table border="0" width="100%" cellspacing="0" cellpadding="0">
<tr>
问题的关键在这里 <td id=submenu0 width="100%">
<table border="0" width="82%" align="center" cellspacing="3">
<tr>
<td width="100%"><a class=left href="ad_win.asp" target="main">首页弹出广告管理</a></td>
</tr>
<tr>
<td width="100%"><a class=left href="about.asp?id=6" target="main">首页Banner管理</a></td>
</tr>
</table>
</td>
</tr>
</table>
</td>
</tr>
<tr>
<td width="100%"><img border="0" src="img/left_b.gif" width="164" height="5"></td>
</tr>
<tr>
<td width="100%" height="10"></td>
</tr>
</table>
问题的关键在这里 <td id=submenu0 width="100%">后面的数字应该等于你括号里的数字.

鼠标滑过和滑出时style 按class menu_title 变化.
揿鼠标时调用showsubmenu(i).

所以,问题在function showsubmenu(int n){..}的声明,网页里有没有包含这个函数,如果这个函数写在另一个.js文件里,你有没有include进来.这个函数本身(语义)写得是否正确.