手机
当前位置:查字典教程网 >编程开发 >Javascript教程 >jQuery树形下拉菜单特效代码分享
jQuery树形下拉菜单特效代码分享
摘要:本文实例讲述了jQuery实现幻树形下拉菜单特效,实现自动伸缩,分享给大家供大家参考。运行jQuery树形下拉菜单特效效果图:为大家分享的j...

本文实例讲述了jQuery实现幻树形下拉菜单特效,实现自动伸缩,分享给大家供大家参考。

运行jQuery树形下拉菜单特效效果图:

jQuery树形下拉菜单特效代码分享1

为大家分享的jQuery树形下拉菜单代码如下

<head> <title>常用的jquery下拉菜单</title> <script type="text/javascript" src="js/jquery.js"></script> <script type="text/javascript"> $(document).ready( function() { $(".menuTitle").click(function(){ $(this).next("div").slideToggle("slow") .siblings(".menuContent:visible").slideUp("slow"); $(this).toggleClass("activeTitle"); $(this).siblings(".activeTitle").removeClass("activeTitle"); }); }); </script> <style type="text/css"> body { margin:0;background-color:#9ad075; } .container { width:100%; text-align:center; } .menuTitle { width:148px; height:25px; background-image:url(images/expand.gif); margin:0 auto; line-height:25px; font-size:12.7px; font-weight:bold;color:#43860c; cursor:pointer; margin-top:6px; } .activeTitle { width:148px; height:25px; background-image:url(images/fold.gif); margin:0 auto; line-height:25px; font-size:12.7px; font-weight:bold;color:#43860c; cursor:pointer; margin-top:6px; } .menuContent { background-color:#fff; margin:0 auto; height:auto; width:148px; text-align:left; display:none; } li { background:url(images/arr.gif) no-repeat 20px 6px ; list-style-type:none;padding:0px 0px 0px 38px; font-size:12.7px; height:20px; line-height:20px; } ul { margin:0;padding:0; } </style> </head> <body> <div> <div> 资源库 </div> <div> <ul> <li> <a href="#">欢迎访问</a></li> <li><a href="http://www.jb51.net/"> 查字典教程网 </a></li> <li><a href="http://www.jb51.net/list/index_1.htm"> 网络编程</a></li> </ul> </div> <div> 文章模块 </div> <div> <ul> <li> <a href="#">前端技术</a></li> <li> <a href="http://www.jb51.net/list/list_21_1.htm">ASP.NET</a></li> <li> <a href="http://www.jb51.net/list/index_104.htm">数据库</a></li> </ul> </div> <div> 下载模块 </div> <div> <ul> <li> <a href="http://www.jb51.net/">查字典教程网 </a></li> <li> <a href="http://www.jb51.net/codes/">源码下载</a></li> <li> <a href="http://www.jb51.net/books/">电子书籍</a></li> </ul> </div> </div> </body> </html>

以上就是为大家分享的jQuery树形下拉菜单代码,希望大家可以喜欢。

【jQuery树形下拉菜单特效代码分享】相关文章:

javascript常用的方法分享

javascript中FOREACH数组方法使用示例

基于jquery实现下拉框美化特效

浅谈jQuery构造函数分析

jQuery插件制作之参数用法实例分析

下拉菜单

jQuery插件bgStretcher.js实现全屏背景特效

jQuery实现html表格动态添加新行的方法

jquery合并表格中相同文本的相邻单元格

jQuery使用zTree插件实现树形菜单和异步加载

精品推荐
分类导航