用jquery 实现下拉菜单

自己在研究学习jquery时编写的一个下拉菜单
  1. <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
  2. <html>
  3. <head>
  4. <meta http-equiv="Content-Type" content="text/html; charset=gbk" />
  5. <title>jackami121@gmail.com</title>
  6. <script type="text/javascript" src="jquery.js"></script>
  7. <script type="text/javascript">
  8. $(document).ready(function(){
  9.     $(".accordion p").hide();
  10.     $(".accordion p:eq(0)").show();
  11.     $(".accordion p:eq(3)").show();
  12.     $(".accordion p:eq(6)").show();
  13.     $(".accordion h3").toggle(function(){
  14.         $(this).next("p").show(1200);
  15.         $(this).find("img").attr("src","images/up.png");
  16.         },function(){
  17.         $(this).next("p").hide(1200);
  18.         $(this).find("img").attr("src","images/down.png");
  19.         });
  20. });
  21. </script>
  22. <style type="text/css">
  23. body {margin-left:16%;padding:0px;font:12px Arial, Helvetica, sans-serif; margin-right:10%; }
  24. .accordion {width: 20%;margin:auto;border-bottom: solid 1px #B1E0F4; }
  25. .accordion h3 {background: #87ceeb url(images/arrow-square.gif) no-repeat right -51px;
  26.     padding: 7px 15px;margin:0;
  27.     font: bold 14px Arial, Helvetica, sans-serif;
  28.     border: solid 1px #B1E0F4;border-bottom: none;cursor: pointer;}
  29. .accordion h3:hover {background:#B1E0F4 url(images/arrow-square.gif) no-repeat right -51px; }
  30. .accordion h3.active {background-position: right 5px}
  31. .accordion p {background: #ffffff;margin:0;padding:0;border-left: solid 1px #87ceeb;border-right: solid 1px #87ceeb;}
  32. p a {display:block;width:100%;line-height:36px;text-indent:16px;color:#000;text-decoration:none}
  33. p a:hover {background:#069;color:#ffffff;font-weight:bold}
  34. </style>
  35. </head>
  36. <body STYLE='OVERFLOW:SCROLL;OVERFLOW-X:HIDDEN;OVERFLOW-Y:HIDDEN'>
  37. <div class="accordion">
  38.  
  39. <h3>主页管理        <img src="images/up.png"></h3>
  40.     <p><a href="/jsp/soway.jsp" target="ContentFrame">主页 </a></p>
  41.     <h3>用户管理        <img src="images/down.png"></h3>
  42.     <p>
  43.     <a href="#" target="ContentFrame">修改密码 </a>
  44.     <a href="#" target="ContentFrame"> 用户信息修改 </a>
  45.     <a href="#" target="ContentFrame"> 增加删除用户 </a>
  46.     <a href="#" target="ContentFrame">登陆日志查询</a>
  47.     </p>
  48.     <h3>用户设置        <img src="images/down.png"></h3>
  49.     <p>
  50.     <a href="#" target="ContentFrame">查看</a>
  51.     <a href="#" target="ContentFrame">设置</a>
  52.     </p>
  53.     <h3>装置管理        <img src="images/up.png"></h3>
  54.     <p>
  55.     <a href="#" target="ContentFrame"> 添加/删除装置 </a>
  56.     <a href="#" target="ContentFrame"> 查看装置信息 </a>
  57.     <a href="#" target="ContentFrame">修改装置信息</a>
  58.     </p>
  59.     <h3>文件下载        <img src="images/down.png"></h3>
  60.     <p>
  61.     <a href="#" target="ContentFrame">事件型文件</a>
  62.     <a href="#" target="ContentFrame">统计型文件</a>
  63.     </p>
  64.     <h3>事件数据        <img src="images/down.png"></h3>
  65.     <p>
  66.     <a href="#" target="ContentFrame">最近事件TOP10</a>
  67.     <a href="#" target="ContentFrame">严重事件TOP10</a>
  68.     <a href="#" target="ContentFrame">事件查询</a>
  69.     </p>
  70.     <h3>统计数据        <img src="images/up.png"></h3>
  71.     
  72.     <p>
  73.     <a href="#" target="ContentFrame"> 统计图 </a>
  74.     <a href="#" target="ContentFrame"> 国标统计报表 </a>
  75.     <a href="#" target="ContentFrame">超标数据查询</a>
  76.     </p>
  77.     <h3>安全退出        <img src="images/down.png"></h3>
  78.     <p>
  79.     <a href="#" target="_parent" onclick="top.sidebarFrame.close()">安全退出 </a>
  80.     </p>
  81. </div>
  82. </body>
  83. </html>
  84. 效果图



  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值