Off-canvas Push Menu jQuery Plugin For Bootstrap

File Size: 7.66 KB
Views Total: 12164
Last Update:
Publish Date:
Official Website: Go to website
License: MIT
Off-canvas Push Menu jQuery Plugin For Bootstrap

A lightweight jQuery plugin that convert default Bootstrap nav bar component into an off-canvas style push menu in mobile view.

How to use it:

1. Makes sure you have jQuery library and Bootstrap framework installed in the webpage.

<link rel="stylesheet" href="bootstrap.min.css">
<script src="jquery.min.js"></script>
<script src="bootstrap.min.js"></script>

2. Download the plugin and include the offcanvas.css and offcanvas.js in the webpage.

<link href="css/offcanvas.min.css" rel="stylesheet">
<script src="js/offcanvas.min.js"></script>

3. Create an empty overlay element for the push menu.

<div class="overlay"></div>

4. Build the html structure for the Bootstrap navbar component as follow.

<nav class="navbar navbar-inverse navbar-static-top">
  <div class="container">
    <div class="navbar-header">
      <button type="button" class="navbar-toggle collapsed pull-left" data-toggle="offcanvas">
        <span class="sr-only">Toggle navigation</span>
        <span class="icon-bar"></span>
        <span class="icon-bar"></span>
        <span class="icon-bar"></span>
      <a class="navbar-brand" href="#">Project name</a>
    <div id="navbar" class="collapse navbar-collapse sidebar-offcanvas">
      <ul class="nav navbar-nav">
        <li class="active"><a href="#">Home</a></li>
        <li><a href="#about">About</a></li>
        <li><a href="#contact">Contact</a></li>
    </div><!--/.nav-collapse -->

Change log:

v1.0.3 (2016-01-06)

This awesome jQuery plugin is developed by eknows. For more Advanced Usages, please check the demo page or visit the official website.