jQuery绚丽的菜单插件sidenav

所属分类:导航-垂直导航

 8860  26  查看评论 (2)
jQuery绚丽的菜单插件sidenav ie兼容10

直接部署即可,文件夹index.html直接打开可查看效果图,js和css文件都在对应文件夹中

sidenav

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

使用方法

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

<link rel="stylesheet" href="dist/sidenav.min.css" type="text/css">
<script src="jquery.min.js"></script>
<script src="dist/sidenav.min.js"></script>

HTML结构

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

<nav class="sidenav" data-sidenav data-sidenav-toggle="#sidenav-toggle">
  <div class="sidenav-brand">
    BRAND
  </div>
 
  <div class="sidenav-header">
    Section Header
    <small>secondary text</small>
  </div>
 
  <ul class="sidenav-menu">
    <li>
      <a href="javascript:;" data-sidenav-dropdown-toggle class="active">
        <span class="sidenav-link-icon">
          <i class="material-icons">store</i>
        </span>
        <span class="sidenav-link-title">Lorem ipsum</span>
        <span class="sidenav-dropdown-icon show" data-sidenav-dropdown-icon>
          <i class="material-icons">arrow_drop_down</i>
        </span>
        <span class="sidenav-dropdown-icon" data-sidenav-dropdown-icon>
          <i class="material-icons">arrow_drop_up</i>
        </span>
      </a>
 
      <ul class="sidenav-dropdown" data-sidenav-dropdown>
        <li><a href="javascript:;">Dolor sit amet</a></li>
        <li><a href="javascript:;">Consectetur adipisicing</a></li>
        <li><a href="javascript:;">Elit</a></li>
      </ul>
    </li>
    <li>
      <a href="javascript:;" data-sidenav-dropdown-toggle>
        <span class="sidenav-link-icon">
          <i class="material-icons">payment</i>
        </span>
        <span class="sidenav-link-title">Sed do eiusmod</span>
        <span class="sidenav-dropdown-icon show" data-sidenav-dropdown-icon>
          <i class="material-icons">arrow_drop_down</i>
        </span>
        <span class="sidenav-dropdown-icon" data-sidenav-dropdown-icon>
          <i class="material-icons">arrow_drop_up</i>
        </span>
      </a>
 
      <ul class="sidenav-dropdown" data-sidenav-dropdown>
        <li><a href="javascript:;">Tempor incididunt</a></li>
        <li><a href="javascript:;">Labore</a></li>
      </ul>
    </li>
    <li>
      <a href="javascript:;" data-sidenav-dropdown-toggle>
        <span class="sidenav-link-icon">
          <i class="material-icons">shopping_cart</i>
        </span>
        <span class="sidenav-link-title">Dolore magna</span>
        <span class="sidenav-dropdown-icon show" data-sidenav-dropdown-icon>
          <i class="material-icons">arrow_drop_down</i>
        </span>
        <span class="sidenav-dropdown-icon" data-sidenav-dropdown-icon>
          <i class="material-icons">arrow_drop_up</i>
        </span>
      </a>
 
      <ul class="sidenav-dropdown" data-sidenav-dropdown>
        <li><a href="javascript:;">Aliqua</a></li>
        <li><a href="javascript:;">Exercitation</a></li>
        <li><a href="javascript:;">Minim veniam</a></li>
      </ul>
    </li>
    <li>
      <a href="javascript:;">
        <span class="sidenav-link-icon">
          <i class="material-icons">assignment_ind</i>
        </span>
        <span class="sidenav-link-title">Nostrud ullamco</span>
      </a>
    </li>
    <li>
      <a href="javascript:;">
        <span class="sidenav-link-icon">
          <i class="material-icons">alarm</i>
        </span>
        <span class="sidenav-link-title">Commodo</span>
      </a>
    </li>
  </ul>
 
  <div class="sidenav-header">
    Another Section Header
  </div>
 
  <ul class="sidenav-menu">
    <li>
      <a href="javascript:;" data-sidenav-dropdown-toggle>
        <span class="sidenav-link-icon">
          <i class="material-icons">date_range</i>
        </span>
        <span class="sidenav-link-title">Reprehenderit</span>
        <span class="sidenav-dropdown-icon show" data-sidenav-dropdown-icon>
          <i class="material-icons">arrow_drop_down</i>
        </span>
        <span class="sidenav-dropdown-icon" data-sidenav-dropdown-icon>
          <i class="material-icons">arrow_drop_up</i>
        </span>
      </a>
 
      <ul class="sidenav-dropdown" data-sidenav-dropdown>
        <li><a href="javascript:;">Voluptate</a></li>
        <li><a href="javascript:;">Excepteur</a></li>
      </ul>
    </li>
    <li>
      <a href="javascript:;">
        <span class="sidenav-link-icon">
          <i class="material-icons">backup</i>
        </span>
        <span class="sidenav-link-title">Occaecat</span>
      </a>
    </li>
    <li>
      <a href="javascript:;">
        <span class="sidenav-link-icon">
          <i class="material-icons">settings</i>
        </span>
        <span class="sidenav-link-title">Deserunt</span>
      </a>
    </li>
  </ul>
</nav>

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

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

初始化插件

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

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


相关插件-垂直导航

jquery下拉菜单导航

jquery hover事件下拉菜单导航仿京东商城商品分类导航样式布局,通过鼠标滑过商品分类导航展示商品分类子菜单内容的效果
  垂直导航
 12263  46

侧边抽屉_纯CSS3抽屉式滑动侧边栏菜单设计

该侧边栏在鼠标滑过菜单项时,会以平滑的方式滑出相应的主菜单,就像拉开抽屉的效果,非常的时尚。
  垂直导航
 7147  34

jQuery绚丽的菜单插件sidenav

sidenav是一款和绚丽的垂直菜单,样式简洁时尚的jQuery和CSS3侧边栏菜单插件。
  垂直导航
 8860  26

当前页面菜单跳转

创建一个平滑跳转到子导航菜单
  垂直导航
 21609  99

讨论这个项目(2)回答他人问题或分享插件使用方法奖励jQ币

    演累精彩人生 0
    2017/4/11 20:33:34
    苹果手机不能关闭,求解!!! 回复
    xiduzhe306 0
    2017/3/13 9:55:04

    苹果手机不能关闭,什么原因呢?

    回复
取消回复