<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "">
<html xmlns=""> <head> <meta http-equiv="content-type" content="text/html;charset=gb2312"><title> 弹出菜单 </title>
<script type="text/javascript" src="C:\Users\Administrator.lcf-PC\Desktop\新建文件夹\jquery-1.3.2.js"> </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>