前端

img studyday

树形菜单

发表于2004/9/29 16:55:00  456人阅读

<HTML><HEAD> <META content="text/html; charset=gb2312" http-equiv=Content-Type> <META content="MSHTML 5.00.2314.1000" name=GENERATOR></HEAD> <BODY> <style> <!-- a.parentlink { text-decoration: none; color: #333333; font-size: 12px } a.parentlink:hover,a.childlink:hover { color: #000000; } a.childlink,td.childlink { text-decoration: none; color: #666666; font-size: 12px } .px7 { font-size: 7px; vertical-align: middle; } --> </style> <script language=javascript> var item_num=7; //父层菜单的行数 var item_word=new Array(); //菜单的文字 for(I=0;I<item_num;I++) item_word[I]=new Array(); item_word[0][0]="户籍信息"; item_word[1][0]="核定信息"; item_word[2][0]="申报信息"; item_word[3][0]="税款入库"; item_word[3][1]="减免"; item_word[3][2]="缓征"; item_word[3][3]="滞纳金加收信息"; item_word[3][4]="提退税款信息"; item_word[3][5]="呆帐税款情况"; item_word[4][0]="欠税信息"; item_word[5][0]="违章、违法处罚信息"; item_word[6][0]="发票领购信息"; item_word[6][1]="发票缴销信息"; item_word[6][2]="发票流失信息"; item_word[6][3]="定额发票缴税情况"; var item_link=new Array(); //菜单的链接 for(I=0;I<item_num;I++) item_link[I]=new Array(); item_link[0][0]="javascript:"; item_link[1][0]="javascript:"; item_link[2][0]="javascript:"; item_link[3][0]="javascript:"; item_link[3][1]="javascript:"; item_link[3][2]="javascript:"; item_link[3][3]="javascript:"; item_link[3][4]="javascript:"; item_link[3][5]="javascript:"; item_link[4][0]="javascript:"; item_link[5][0]="javascript:"; item_link[6][0]="javascript:"; item_link[6][1]="javascript:"; item_link[6][2]="javascript:"; item_link[6][3]="javascript:"; var item=new Array(); //菜单的HTML for(I=0;I<item_num;I++) item[I]=""; for(I=0;I<item_num;I++) for(j=0;j<item_word[I].length;j++) item[I]+=" |<span class=px7>-● </span> <a class=childlink href="+item_link[I][j]+" onclick=javascript:this.blur();>"+item_word[I][j]+"</a><br>"; //------------定义一个清空各菜单的函数-------------- function startItem() { for(I=0;I<item_num;I++) document.all.titem.cells[2*I+1].innerHTML=""; } //------------------定义结束---------------------- //------------定义一个菜单展开的函数---------------- function openItem(n) { if(document.all.titem.cells[n*2+1].innerHTML=="") { startItem(); document.all.titem.cells[n*2+1].innerHTML=item[n]; } else startItem(); } //------------------定义结束---------------------- //-----------------开始实现菜单------------------- document.writeln("<table id=titem>"); document.writeln(" <tr><td height=20 valign=bottom><span class=px7>● </span> <a class=parentlink href=javascript: onclick=javascript:openItem(0);this.blur();>户籍信息</a></td></tr>"); document.writeln(" <tr><td class=childlink></td></tr>"); document.writeln(" <tr><td height=20 valign=bottom><span class=px7>● </span> <a class=parentlink href=javascript: onclick=javascript:openItem(1);this.blur();>核定信息</a></td></tr>"); document.writeln(" <tr><td class=childlink></td></tr>"); document.writeln(" <tr><td height=20 valign=bottom><span class=px7>● </span> <a class=parentlink href=javascript: onclick=javascript:openItem(2);this.blur();>申报信息</a></td></tr>"); document.writeln(" <tr><td class=childlink></td></tr>"); document.writeln(" <tr><td height=20 valign=bottom><span class=px7>● </span> <a class=parentlink href=javascript: onclick=javascript:openItem(3);this.blur();>征收信息</a></td></tr>"); document.writeln(" <tr><td class=childlink></td></tr>"); document.writeln(" <tr><td height=20 valign=bottom><span class=px7>● </span> <a class=parentlink href=javascript: onclick=javascript:openItem(4);this.blur();>欠税信息</a></td></tr>"); document.writeln(" <tr><td class=childlink></td></tr>"); document.writeln(" <tr><td height=20 valign=bottom><span class=px7>● </span> <a class=parentlink href=javascript: onclick=javascript:openItem(5);this.blur();> 违章、违法处罚信息</a></td></tr>"); document.writeln(" <tr><td class=childlink></td></tr>"); document.writeln(" <tr><td height=20 valign=bottom><span class=px7>● </span> <a class=parentlink href=javascript: onclick=javascript:openItem(6);this.blur();>发票信息</a></td></tr>"); document.writeln(" <tr><td class=childlink></td></tr>"); document.writeln("</table>"); //------------------菜单结束----------------------- </script> </BODY></HTML>
阅读全文
0 0

相关文章推荐

img
取 消
img