全网整合营销服务商

电脑端+手机端+微信端=数据同步管理

免费咨询热线:400-708-3566

jQuery实现下拉菜单的实例代码

基本效果是这样的~~

<!DOCTYPE html>
<html>
<head lang="en">
  <meta charset="UTF-8">
  <title></title>
  <style type="text/css">
    * {
      margin: 0;
      padding: 0;
    }
    ul {
      list-style: none;
    }
    .wrap {
      width: 330px;
      height: 30px;
      margin: 100px auto 0;
      padding-left: 10px;
      background-color: skyblue;
    }
    .wrap li {
      background-color: skyblue;
    }
    .wrap > ul > li {
      float: left;
      margin-right: 10px;
      position: relative;
    }
    .wrap a {
      display: block;
      height: 30px;
      width: 100px;
      text-decoration: none;
      color: #000;
      line-height: 30px;
      text-align: center;
    }
    .wrap li ul {
      position: absolute;
      top: 30px;
      display: none;
    }
  </style>
  <script src="http://apps.bdimg.com/libs/jquery/2.1.4/jquery.js"></script>
  <script>
    $(function () {
      //获取所有li,添加移入事件
      $(".wrap>ul>li").mouseenter(function () {
        //设置内部的子元素ul slideDown
        $(this).children("ul").stop().slideDown(600);
      });
      //移出li时,让内部子元素slideUp
      $(".wrap>ul>li").mouseleave(function () {
        $(this).children("ul").stop().slideUp(600);
      });
      //如果当前运动没有完毕,又添加了新的动画,这时新的动画需要等待当前动画执行完毕才会开始
      //如果持续添加。一定会造成动画的积累,这种情况我们称为动画队列
    });
  </script>
</head>
<body>
<div class="wrap">
  <ul>
    <li>
      <a href="javascript:void(0);" rel="external nofollow" rel="external nofollow" rel="external nofollow" rel="external nofollow" rel="external nofollow" rel="external nofollow" rel="external nofollow" rel="external nofollow" rel="external nofollow" rel="external nofollow" rel="external nofollow" rel="external nofollow" >一级菜单1</a>
      <ul class="ul">
        <li><a href="javascript:void(0);" rel="external nofollow" rel="external nofollow" rel="external nofollow" rel="external nofollow" rel="external nofollow" rel="external nofollow" rel="external nofollow" rel="external nofollow" rel="external nofollow" rel="external nofollow" rel="external nofollow" rel="external nofollow" >二级菜单11</a></li>
        <li><a href="javascript:void(0);" rel="external nofollow" rel="external nofollow" rel="external nofollow" rel="external nofollow" rel="external nofollow" rel="external nofollow" rel="external nofollow" rel="external nofollow" rel="external nofollow" rel="external nofollow" rel="external nofollow" rel="external nofollow" >二级菜单12</a></li>
        <li><a href="javascript:void(0);" rel="external nofollow" rel="external nofollow" rel="external nofollow" rel="external nofollow" rel="external nofollow" rel="external nofollow" rel="external nofollow" rel="external nofollow" rel="external nofollow" rel="external nofollow" rel="external nofollow" rel="external nofollow" >二级菜单13</a></li>
      </ul>
    </li>
    <li>
      <a href="javascript:void(0);" rel="external nofollow" rel="external nofollow" rel="external nofollow" rel="external nofollow" rel="external nofollow" rel="external nofollow" rel="external nofollow" rel="external nofollow" rel="external nofollow" rel="external nofollow" rel="external nofollow" rel="external nofollow" >一级菜单2</a>
      <ul>
        <li><a href="javascript:void(0);" rel="external nofollow" rel="external nofollow" rel="external nofollow" rel="external nofollow" rel="external nofollow" rel="external nofollow" rel="external nofollow" rel="external nofollow" rel="external nofollow" rel="external nofollow" rel="external nofollow" rel="external nofollow" >二级菜单21</a></li>
        <li><a href="javascript:void(0);" rel="external nofollow" rel="external nofollow" rel="external nofollow" rel="external nofollow" rel="external nofollow" rel="external nofollow" rel="external nofollow" rel="external nofollow" rel="external nofollow" rel="external nofollow" rel="external nofollow" rel="external nofollow" >二级菜单22</a></li>
        <li><a href="javascript:void(0);" rel="external nofollow" rel="external nofollow" rel="external nofollow" rel="external nofollow" rel="external nofollow" rel="external nofollow" rel="external nofollow" rel="external nofollow" rel="external nofollow" rel="external nofollow" rel="external nofollow" rel="external nofollow" >二级菜单23</a></li>
      </ul>
    </li>
    <li>
      <a href="javascript:void(0);" rel="external nofollow" rel="external nofollow" rel="external nofollow" rel="external nofollow" rel="external nofollow" rel="external nofollow" rel="external nofollow" rel="external nofollow" rel="external nofollow" rel="external nofollow" rel="external nofollow" rel="external nofollow" >一级菜单3</a>
      <ul>
        <li><a href="javascript:void(0);" rel="external nofollow" rel="external nofollow" rel="external nofollow" rel="external nofollow" rel="external nofollow" rel="external nofollow" rel="external nofollow" rel="external nofollow" rel="external nofollow" rel="external nofollow" rel="external nofollow" rel="external nofollow" >二级菜单31</a></li>
        <li><a href="javascript:void(0);" rel="external nofollow" rel="external nofollow" rel="external nofollow" rel="external nofollow" rel="external nofollow" rel="external nofollow" rel="external nofollow" rel="external nofollow" rel="external nofollow" rel="external nofollow" rel="external nofollow" rel="external nofollow" >二级菜单32</a></li>
        <li><a href="javascript:void(0);" rel="external nofollow" rel="external nofollow" rel="external nofollow" rel="external nofollow" rel="external nofollow" rel="external nofollow" rel="external nofollow" rel="external nofollow" rel="external nofollow" rel="external nofollow" rel="external nofollow" rel="external nofollow" >二级菜单33</a></li>
      </ul>
    </li>
  </ul>
</div>
</body>
</html>

以上所述是小编给大家介绍的jQuery实现下拉菜单的实例代码,希望对大家有所帮助,如果大家有任何疑问请给我留言,小编会及时回复大家的。在此也非常感谢大家对网站的支持!


# jQuery实现下拉菜单  # jQuery下拉菜单的实现代码  # jQuery实现的导航下拉菜单效果示例  # jQuery实现的导航下拉菜单效果  # jQuery插件cxSelect多级联动下拉菜单实例解析  # 基于jquery实现三级下拉菜单  # Jquery+ajax+JAVA(servlet)实现下拉菜单异步取值  # 小编  # 在此  # 是这样  # 才会  # 给大家  # 这种情况  # 所述  # 给我留言  # 感谢大家  # 又添  # 疑问请  # 有任何  # 移出  # width  # wrap  # px  # list  # padding  # ul  # css 


相关文章: 模具网站制作流程,如何找模具客户?  我的世界制作壁纸网站下载,手机怎么换我的世界壁纸?  建站上传速度慢?如何优化加速网站加载效率?  实例解析Array和String方法  品牌网站制作公司有哪些,买正品品牌一般去哪个网站买?  网站制作与设计教程,如何制作一个企业网站,建设网站的基本步骤有哪些?  网站海报制作教学视频教程,有什么免费的高清可商用图片网站,用于海报设计?  网站制作哪家好,cc、.co、.cm哪个域名更适合做网站?  香港服务器网站搭建教程-电商部署、配置优化与安全稳定指南  小捣蛋自助建站系统:数据分析与安全设置双核驱动网站优化  微信小程序制作网站有哪些,微信小程序需要做网站吗?  油猴 教程,油猴搜脚本为什么会网页无法显示?  建站之星会员如何解锁更多建站功能?  青浦网站制作公司有哪些,苹果官网发货地是哪里?  如何快速搭建安全的FTP站点?  seo网站制作优化,网站SEO优化步骤有哪些?  ,交易猫的商品怎么发布到网站上去?  枣阳网站制作,阳新火车站打的到仙岛湖多少钱?  广州网站制作公司哪家好一点,广州欧莱雅百库网络科技有限公司官网?  南京网站制作费用,南京远驱官方网站?  代购小票制作网站有哪些,购物小票的简要说明?  定制建站流程解析:需求评估与SEO优化功能开发指南  高防服务器租用首荐平台,企业级优惠套餐快速部署  javascript中对象的定义、使用以及对象和原型链操作小结  如何使用Golang table-driven基准测试_多组数据测量函数效率  如何在IIS7上新建站点并设置安全权限?  建站VPS能否同时实现高效与安全翻墙?  文字头像制作网站推荐软件,醒图能自动配文字吗?  制作网站的公司有哪些,做一个公司网站要多少钱?  如何做网站制作流程,*游戏网站怎么搭建?  微信网站制作公司有哪些,民生银行办理公司开户怎么在微信网页上查询进度?  如何在IIS服务器上快速部署高效网站?  如何正确选择百度移动适配建站域名?  如何在沈阳梯子盘古建站优化SEO排名与功能模块?  桂林网站制作公司有哪些,桂林马拉松怎么报名?  网站制作大概要多少钱一个,做一个平台网站大概多少钱?  c++怎么编写动态链接库dll_c++ __declspec(dllexport)导出与调用【方法】  如何通过虚拟机搭建网站?详细步骤解析  如何高效完成独享虚拟主机建站?  制作无缝贴图网站有哪些,3dmax无缝贴图怎么调?  建设网站制作价格,怎样建立自己的公司网站?  如何选择适合PHP云建站的开源框架?  娃派WAP自助建站:免费模板+移动优化,快速打造专业网站  国美网站制作流程,国美电器蒸汽鍋怎么用官方网站?  如何通过IIS搭建网站并配置访问权限?  如何选择高效便捷的WAP商城建站系统?  如何配置IIS站点权限与局域网访问?  高端网站建设与定制开发一站式解决方案 中企动力  岳西云建站教程与模板下载_一站式快速建站系统操作指南  非常酷的网站设计制作软件,酷培ai教育官方网站? 

您的项目需求

*请认真填写需求信息,我们会在24小时内与您取得联系。