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如何实现二级导航功能”这篇文章的所有内容,感谢各位的阅读!相信大家都有了一定的了解,希望分享的内容对大家有所帮助,如果还想学习更多知识,欢迎关注创新互联网站建设公司行业资讯频道!

    另外有需要云服务器可以了解下创新互联建站www.cdcxhl.com,海内外云服务器15元起步,三天无理由+7*72小时售后在线,公司持有idc许可证,提供“云服务器、裸金属服务器、高防服务器、香港服务器、美国服务器、虚拟主机、免备案服务器”等云主机租用服务以及企业上云的综合解决方案,具有“安全稳定、简单易用、服务可用性高、性价比高”等特点与优势,专为企业上云打造定制,能够满足用户丰富、多元化的应用场景需求。


    当前题目:js如何实现二级导航功能-创新互联
    文章来源:http://pwwzsj.com/article/dsicip.html