JavaScript Library for Off-Canvas Menus (mobile style) | offcanvas.js

offcanvas.js is a lightweight JavaScript library that helps developers create fast mobile-style navigation (push list) on your web application.

responsive off canvas menu, off canvas menu examples, off canvas menu jquery, off canvas menu bootstrap, off canvas sidebar, off canvas menu wordpress

How to make use of it:

1. Install & build.

$ npm i offcanvas
$ npm install
$ npm run-script build

2. Load the offcanvas.bundle.js JavaScript library within the doc.

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

3. Or import the off-canvas as an ES module.

@import 'offcanvas/offcanvas.css';
import 'offcanvas';

4. Create off-canvas menus on the web page.

<div class="offcanvas left" data-offcanvas="navleft">
  <p>This is the left nav</p>
  <button data-offcanvas-trigger="navleft">This will close the nav</button>
</div>

<div class="offcanvas right" data-offcanvas="navright">
  <p>This is the right nav</p>
</div>

5. Create trigger buttons to toggle the off-canvas menus.

<div class="offcanvas-content" data-offcanvas-content>
  <div class="buttons" data-offcanvas-fixed>
    <button data-offcanvas-trigger="navleft">Show left nav</button>
    <button data-offcanvas-trigger="navright">Show right nav</button>
  </div>
  ... main content here ...
</div>

6. Wrap them right into a container with the CSS class of offcanvas-wrapper.

<div class="offcanvas-wrapper">
  ...
</div>

7. Enable the off-canvas menu only when operating on mobile gadgets.

<div class="offcanvas right" data-offcanvas="navright" data-offcanvas-match="(max-width: 767px)">
  <p>This is the right nav</p>
</div>

Lightweight Off-canvas (Push) Menu, offcanvas Plugin/Github, off canvas menu elementor


See Demo And Download

Official Website(firstandthird): Click Here

This superior jQuery/javascript plugin is developed by firstandthird. For extra Advanced Usages, please go to the official website.

Related Posts

Input-Values-Using-Mouse-Drag

Create Side Sliders Input Values Using Mouse Drag | Pointer Lock

HTML Range Slider is a lightweight library to create side sliders to adjust values easily and precisely by making use of the Pointer Lock API. Side Slider…

simple-parallax-scrolling-js

Smooth and Lightweight Parallax Scroll Library in Pure Javascript

Lightweight and seamless parallax scrolling library implemented in pure javascript using hardware acceleration for additional performance. Main Features Extremely lightweight with no dependencies A few kilobytes of pure…

Convert-Form-Data-to-JSON

How to Convert Form Data to JSON with HTML Forms | FormsJS

FormsJS is a simple-to-use JavaScript library that covers type subject values to JSON in real time. The items containing the data category will be analyzed automatically. It…

editable-html-table-using-javascript

A Small jQuery Extension to Convert An Editable HTML Table

Editable Table is a small jQuery extension to convert an editable HTML table for fast data entry and validation. A small jQuery extension to convert a static…

jquery.youtube-background

Simple jQuery Plugin for Embedding YouTube Videos As Cover Background

jquery.youtube-background is a jQuery plugin built to facilitate YouTube embeds as cover wallpaper using the YouTube Embed API. There is another jQuery Youtube Video Background plugin that…

Data-Table-Generator-Tabulator

Interactive Data Table Generator with JS/jQuery and JSON | Tabulator

Tabulator allows you to create interactive tables in seconds from any HTML Table, JavaScript array, AJAX data source, or JSON format data. Just include the library in your…