弹出菜单

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="content-type" content="text/html;charset=gb2312">

<title> 弹出菜单 </title>
<script type="text/javascript" src=\'#\'" /> </script>
<style type="text/css">
//使所有li都不显示小圆点,用css标签选择器
   li {
   list-style:none;
   margin-left:18px;
 
}
</style>
<script type="text/javascript">
 $(document).ready(function (){
    var as=$("ul>a");
    as.click(function (){
    //获取当前ul节点
 var ulNode=$(this);
 ulNode.nextAll("li").toggle("show");
   });
 })
</script>
</head>
<body>
  <ul>菜单
     <li>子菜单1</li>
  <li>子菜单2</li>
  </ul>
 <ul> 菜单2
     <li>子菜单3</li>
  <li>子菜单4</li>
  </ul>

</body>
</html>

你可能感兴趣的:(html,弹出菜单)