日期:2014-05-16  浏览次数:20388 次

老裴帮助关于Javascript动态菜单树的小练习3

<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<html>
? <head>
??? <title>菜单树</title>
??? <meta http-equiv="keywords" content="keyword1,keyword2,keyword3">
??? <meta http-equiv="description" content="this is my page">
??? <meta http-equiv="content-type" content="text/html; charset=UTF-8">
???? <style type="text/css">
??? #treeboder{
?? ?border-width:1px;
??? border-style:solid;
??? border-color:#06a;
??? padding:25px;
??? width:250px;?
??? }
??? </style>
</head>

<script type="text/javascript">
function nodeselect(menu){
alert("你点击的是:"+menu);
}
</script>
? <body >
<!--********树形菜单边界 *****************-->
<div id="treeboder" style="">
<!--******** 树形菜单内容 *****************-->
<ul id="tmenu0" style="display:block;">

?<li ><span>菜单1</span>
??<ul>
???<li><span>菜单1.1</span>
????<ul style="background-image:url(images/sample1_sub_sub_bg.gif);">
?????<li><a href="javascript:nodeselect('菜单1.1.1');">菜单1.1.1</a></li>
?????<li><a href="javascript:nodeselect('菜单1.1.2')">菜单1.1.2</a></li>
?????<li><a href="javascript:nodeselect('菜单1.1.3')">菜单1.1.3</a></li>
????</ul>
???</li>
??<li><span>菜单1.2</span>
????<ul style="background-image:url(images/sample1_sub_sub_bg.gif);">
?????<li><a href="javascript:nodeselect('菜单1.2.1');">菜单1.2.1</a></li>
?????<li><a href="javascript:nodeselect('菜单1.2.2')">菜单1.2.2</a></li>
?????<li><a href="javascript:nodeselect('菜单1.2.3')">菜单1.2.3</a></li>
????</ul>
???</li>
??<li><a href="javascript:nodeselect('菜单1.3');">菜单1.3</a></li>
??<li><a href="javascript:nodeselect('菜单1.4');">菜单1.4</a></li>
??<li><a href="javascript:nodeselect('菜单1.5');">菜单1.5</a></li>
??</ul>
??
??<li><span >菜单2</span>
???<ul>
????<li><a href="javascript:nodeselect('菜单2.1');">菜单2.1</a></li>
????<li><a href="javascript:nodeselect('菜单2.2');">菜单2.2</a></li>
????<li><a href="javascript:nodeselect('菜单2.3');">菜单2.3</a></li>
???</ul>
??</li>
??
?</ul>

</div>
? <script language="JavaScript" src="tmenu_control.js"></script>
? <script language="JavaScript" src="tmenu_code.js"></script>
? </body>
</html>