Skip to content
Related Articles

Related Articles

Improve Article

jQuery Slidebar.js Plugin

  • Difficulty Level : Easy
  • Last Updated : 18 Jan, 2021

JQuery is a small, fast, rich JavaScript Library that is an optimized version of JavaScript. It provides us with a simple API that helps in HTML document traversal and manipulation, event handling, animation, and Ajax. jQuery provide us with a variety of plugins that can be implemented on the website, one of which is Slidebar.js.

Slidebar.js: It is a jQuery Plugin that helps us to create a slidebar along with an animation. It helps in implementing mobile app-style revealing menus and sidebars into our website. 

There are four types of slidebars that can be created:

  1. Left Slidebar
  2. Right Slidebar
  3. Top Slidebar
  4. Bottom Slidebar

In this article, we will be learning about how to implement a left sidebar on our website. But before that, we need to add some CDNs in order to make the slidebar work.

1. Include jQuery CDN

<script src=”” type=”text/javascript”></script>

2. Include Slidebar.js CDNs(JS and CSS)

<script src=”” type=”text/javascript”></script>
<link rel=”stylesheet” href=””>

Now, we have included all the necessary CDNs, let’s move to the Original Code.



<!DOCTYPE html>
    <title>Slidebar Demo</title>
    <link rel="stylesheet" href=
    <script src=
    <script src=
    <div canvas="container" class="slidebar-button">
        <!-- Creating a heading -->
        <h2>Slidebar Demo</h2>
        <!-- Creating a button, clicking on
            which the left slidebar will open -->
        <button class="js-toggle-left">
            Left Slide Button
    <div class="slidebar-content">
        <div off-canvas="left-slidebar left reveal">
                <li>Computer Science</li><br>
                <li>Electronics </li><br>
        (function ($) {
            "use strict";
            // Creating an instance of Slidebars
            var controller = new slidebars();
            // Initialize Slidebars
            // left Slidebar controls
            $('.js-toggle-left').on('click', function (event) {
            $('opened', function () {
            $('closed', function () {
            $('body').on('click', '.js-close-any-slidebar', 
            function (event) {


Before click the Button:

After click the Button:

My Personal Notes arrow_drop_up
Recommended Articles
Page :