导航菜单

简洁时尚jQuery和CSS3侧边栏菜单插件

阿里云

sidenav 是一款简洁时尚的 jQuery 和 CSS3 侧边栏菜单插件。该侧边栏插件具有手风琴的多级菜单效果,使用简单,效果简洁大方。

使用方法:

在页面中引入 sidenav.min.css、jquery 和 sidenav.min.js 文件。

也想出现在这里?联系我们
创客主机
  1. <link rel="stylesheet" href="dist/sidenav.min.css" type="text/css">
  2. <script src="jquery.min.js"></script>
  3. <script src="dist/sidenav.min.js"></script>

HTML 结构:

该侧边栏菜单的 HTML 结构如下。

  1. <nav class="sidenav" data-sidenav data-sidenav-toggle="#sidenav-toggle">
  2.   <div class="sidenav-brand">
  3.     BRAND
  4.   </div>
  5.  
  6.   <div class="sidenav-header">
  7.     Section Header
  8.     <small>secondary text</small>
  9.   </div>
  10.  
  11.   <ul class="sidenav-menu">
  12.     <li>
  13.       <a href="javascript:;" data-sidenav-dropdown-toggle class="active">
  14.         <span class="sidenav-link-icon">
  15.           <i class="material-icons">store</i>
  16.         </span>
  17.         <span class="sidenav-link-title">Lorem ipsum</span>
  18.         <span class="sidenav-dropdown-icon show" data-sidenav-dropdown-icon>
  19.           <i class="material-icons">arrow_drop_down</i>
  20.         </span>
  21.         <span class="sidenav-dropdown-icon" data-sidenav-dropdown-icon>
  22.           <i class="material-icons">arrow_drop_up</i>
  23.         </span>
  24.       </a>
  25.  
  26.       <ul class="sidenav-dropdown" data-sidenav-dropdown>
  27.         <li><a href="javascript:;">Dolor sit amet</a></li>
  28.         <li><a href="javascript:;">Consectetur adipisicing</a></li>
  29.         <li><a href="javascript:;">Elit</a></li>
  30.       </ul>
  31.     </li>
  32.     <li>
  33.       <a href="javascript:;" data-sidenav-dropdown-toggle>
  34.         <span class="sidenav-link-icon">
  35.           <i class="material-icons">payment</i>
  36.         </span>
  37.         <span class="sidenav-link-title">Sed do eiusmod</span>
  38.         <span class="sidenav-dropdown-icon show" data-sidenav-dropdown-icon>
  39.           <i class="material-icons">arrow_drop_down</i>
  40.         </span>
  41.         <span class="sidenav-dropdown-icon" data-sidenav-dropdown-icon>
  42.           <i class="material-icons">arrow_drop_up</i>
  43.         </span>
  44.       </a>
  45.  
  46.       <ul class="sidenav-dropdown" data-sidenav-dropdown>
  47.         <li><a href="javascript:;">Tempor incididunt</a></li>
  48.         <li><a href="javascript:;">Labore</a></li>
  49.       </ul>
  50.     </li>
  51.     <li>
  52.       <a href="javascript:;" data-sidenav-dropdown-toggle>
  53.         <span class="sidenav-link-icon">
  54.           <i class="material-icons">shopping_cart</i>
  55.         </span>
  56.         <span class="sidenav-link-title">Dolore magna</span>
  57.         <span class="sidenav-dropdown-icon show" data-sidenav-dropdown-icon>
  58.           <i class="material-icons">arrow_drop_down</i>
  59.         </span>
  60.         <span class="sidenav-dropdown-icon" data-sidenav-dropdown-icon>
  61.           <i class="material-icons">arrow_drop_up</i>
  62.         </span>
  63.       </a>
  64.  
  65.       <ul class="sidenav-dropdown" data-sidenav-dropdown>
  66.         <li><a href="javascript:;">Aliqua</a></li>
  67.         <li><a href="javascript:;">Exercitation</a></li>
  68.         <li><a href="javascript:;">Minim veniam</a></li>
  69.       </ul>
  70.     </li>
  71.     <li>
  72.       <a href="javascript:;">
  73.         <span class="sidenav-link-icon">
  74.           <i class="material-icons">assignment_ind</i>
  75.         </span>
  76.         <span class="sidenav-link-title">Nostrud ullamco</span>
  77.       </a>
  78.     </li>
  79.     <li>
  80.       <a href="javascript:;">
  81.         <span class="sidenav-link-icon">
  82.           <i class="material-icons">alarm</i>
  83.         </span>
  84.         <span class="sidenav-link-title">Commodo</span>
  85.       </a>
  86.     </li>
  87.   </ul>
  88.  
  89.   <div class="sidenav-header">
  90.     Another Section Header
  91.   </div>
  92.  
  93.   <ul class="sidenav-menu">
  94.     <li>
  95.       <a href="javascript:;" data-sidenav-dropdown-toggle>
  96.         <span class="sidenav-link-icon">
  97.           <i class="material-icons">date_range</i>
  98.         </span>
  99.         <span class="sidenav-link-title">Reprehenderit</span>
  100.         <span class="sidenav-dropdown-icon show" data-sidenav-dropdown-icon>
  101.           <i class="material-icons">arrow_drop_down</i>
  102.         </span>
  103.         <span class="sidenav-dropdown-icon" data-sidenav-dropdown-icon>
  104.           <i class="material-icons">arrow_drop_up</i>
  105.         </span>
  106.       </a>
  107.  
  108.       <ul class="sidenav-dropdown" data-sidenav-dropdown>
  109.         <li><a href="javascript:;">Voluptate</a></li>
  110.         <li><a href="javascript:;">Excepteur</a></li>
  111.       </ul>
  112.     </li>
  113.     <li>
  114.       <a href="javascript:;">
  115.         <span class="sidenav-link-icon">
  116.           <i class="material-icons">backup</i>
  117.         </span>
  118.         <span class="sidenav-link-title">Occaecat</span>
  119.       </a>
  120.     </li>
  121.     <li>
  122.       <a href="javascript:;">
  123.         <span class="sidenav-link-icon">
  124.           <i class="material-icons">settings</i>
  125.         </span>
  126.         <span class="sidenav-link-title">Deserunt</span>
  127.       </a>
  128.     </li>
  129.   </ul>
  130. </nav>

使用下面的代码来创建一个汉堡包按钮,用于打开侧边栏菜单。

  1. <a href="javascript:;" class="toggle" id="sidenav-toggle">
  2.   <i class="material-icons">menu</i>
  3. </a>

初始化插件:

在页面 DOM 元素加载完毕之后,通过下面的方法来初始化该侧边栏菜单。

  1. $('[data-sidenav]').sidenav();

sidenav 侧边栏菜单插件的 github 地址为:https://github.com/eumatheusgomes/sidenav

简洁时尚 jQuery 和 CSS3 侧边栏菜单插件

已有 386 人购买
查看演示升级 VIP立刻购买

演示地址 下载地址
收藏
(0)

发表回复

热销模板

Ashade - 作品展示摄影相册WordPress汉化主题
LensNews

本站承接 WordPress / PbootCMS / DedeCMS 等
系统建站、仿站、开发、定制等业务!