资讯

精准传达 • 有效沟通

从品牌网站建设到网络营销策划,从策略到执行的一站式服务

js如何实现二级导航功能

小编给大家分享一下js如何实现二级导航功能,相信大部分人都还不怎么了解,因此分享这篇文章给大家参考一下,希望大家阅读完这篇文章后大有收获,下面让我们一起去了解一下吧!

网站建设哪家好,找成都创新互联公司!专注于网页设计、网站建设、微信开发、重庆小程序开发公司、集团企业网站建设等服务项目。为回馈新老客户创新互联还提供了防城港免费建站欢迎大家使用!

效果图:

js如何实现二级导航功能

代码如下:



 
 
 
 
  a{text-decoration: none;}
  *{margin: 0;padding: 0;box-sizing: border-box;font-family: "微软雅黑";}
  li{list-style-type: none;}
  .box{width: 220px;height: 477px;margin-top: 110px;margin-left: 100px;}
  h4{width: 100%;height: 50px;line-height: 50px;text-align: center;background: #09f;}
  h4 a{color: #FFFFFF;}
  h4 a:hover{color: deeppink;}
  ul li{width: 100%;height: 70px;line-height: 70px;border: 1px solid red;background: #09e;}
  ul li:not(:last-child){border-bottom: none;}
  ul li a{display: block;color:#FFFFFF;text-align: center;font-weight: bold;font-size: 18px;}
  ul li:hover{background: #00E8D7;}
  ul li:hover a{color: orange;}
  ul{position: relative;}
  .content{
  position: absolute;top:0;left: 220px;
  width: 800px;height: 300px;
  border: 1px solid #00FF66;
  display: none;
  }
 
 
 
 
  end():结束当前链条中最近的筛选操作,并将匹配元素还原为之前的匹配状态。
 

    

全部菜单

  
      
  •    一级导航        11111111111111111111111111    
     
  •    一级导航        22222222222222222222222222    
  •      
  •    一级导航        33333333333333333333333333333    
  •      
  •    一级导航        44444444444444444444       
  •   
  •    一级导航        5555555555555555555555555555       
  •   
  •    一级导航        6666666666666666666666666666666666       
  •         $(function(){  $('ul li').hover(function(){   $(this).find('.content').show().end().siblings().find('.content').hide();  },function(){   $(this).find('.content').hide();  });   })

    以上是“js如何实现二级导航功能”这篇文章的所有内容,感谢各位的阅读!相信大家都有了一定的了解,希望分享的内容对大家有所帮助,如果还想学习更多知识,欢迎关注创新互联行业资讯频道!


    网页名称:js如何实现二级导航功能
    当前URL:http://cdkjz.cn/article/ieepjh.html
    多年建站经验

    多一份参考,总有益处

    联系快上网,免费获得专属《策划方案》及报价

    咨询相关问题或预约面谈,可以通过以下方式与我们联系

    业务热线:400-028-6601 / 大客户专线   成都:13518219792   座机:028-86922220