简单的二级下拉菜单

js

	  var btn = $('.j-navMenu-anim'),
    modal = $('.nav-modal'),
    panel = $('.j-navMenu-panel');
  function hide() {
    modal.removeClass('nav-show')
    panel.css('transform', 'translate3D(0,0,0)')
  }
  modal.click(function() {
    hide()
    $("body").css('overflow-y', 'auto')
  })
  btn.click(function(evt) {
    if (modal.hasClass('nav-show')) {
      hide()
      $("body").css('overflow-y', 'auto')
    } else {
      modal.addClass('nav-show')
      panel.css('transform', 'translate3D(-100%,0,0)')
      $("body").css('overflow-y', 'hidden')
    }
  });
  $('.iconfont').click(function() {
    if ($(this).hasClass('arrowdown')) {
      $(this).removeClass('arrowdown').addClass('arrowup')
      $(this).parent().next().css('display', 'block')

    } else {
      $(this).removeClass('arrowup').addClass('arrowdown')
      $(this).parent().next().css('display', 'none')
    }
  })

html

<ul class="navList">
  <li class="navItem">
    <div class="yiji">
      <a class="pullDown fl" href='javascript:void(0)'>
        扩声系统              </a>
      <span class="iconfont fr arrowdown"></span>
    </div>
    <ul class="item-list clearFix arrowdown">
      <li>
        <a href='/dyt.html'>
          调音台
        </a>
      </li>
    </ul>
  </li>
  <li class="navItem">
    <div class="yiji">
      <a class="pullDown fl" href='javascript:void(0)'>
        分布式系统
      </a>
      <span class="iconfont fr arrowdown"></span>
    </div>
    <ul class="item-list clearFix arrowdown">
      <li>
        <a href='/fbskvmjd.html'>
          分布式KVM节点
        </a>
      </li>
    </ul>
  </li>
</ul>

css

.Menu{width: 200px;padding: 70px 0;}
.Menu .navList{width:100%;}
.Menu .navList .navItem{color:#333;border-bottom:1px solid #ccc;}
.Menu .navList .navItem > .yiji{color:#fff;display:flex;height:40px;justify-content:space-between;align-items:center;padding:0 10px;font-size:14px;}
.Menu .navList .navItem .gywmen{color:#fff;display:flex;height:40px;ustify-content:space-between;align-items:center;padding:0 10px;font-size:14px;}
.Menu .navList .navItem .yiji a{display: block;width: 80%;height: 100%;color: #333;line-height: 40px; font-weight: 800;}
.Menu .navList .navItem .yiji span{width: 15px;height: 15px;display: block;background: url("../images/icon_down.png") no-repeat center center;background-size: 100% 100%}
.Menu .navList .navItem .yiji span.arrowdown{background: url("../images/icon_down.png") no-repeat center center;background-size: 100% 100%}
.Menu .navList .navItem .yiji span.arrowup{background: url("../images/icon_up.png") no-repeat center center;background-size: 100% 100%}
.Menu .navList .navItem .item-list{padding:0 0 12px 20px;display: none;}
.Menu .navList .navItem .item-list >li.dt{font-weight: bold}
.Menu .navList .navItem .item-list >li{height:28px;line-height:28px;width:100%;text-align:left;white-space:nowrap;font-size: 14px;float: left}
.Menu .navList .navItem .item-list >li a{color: #333}
.Menu .navList .navItem .item-list >a{height:28px;line-height:28px;width:100%;text-align:left;white-space:nowrap;font-size: 14px;float: left;color: #fff}
.Menu .navList .navItem > .yiji1{color:#fff;display:flex;height:40px;border-bottom:1px solid #ccc;justify-content:space-between;align-items:center;padding:0 20px;font-size:14px;}
.Menu .navList .navItem > .yiji1 a{display: block;width: 33.3%;height: 100%;color: #333;line-height: 40px; font-weight: 800;}
.Menu .navList .navItem .item-list >li a.avt{color: rgb(0, 123, 211)}
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

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

抵扣说明:

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

余额充值