August 16, 2022

Responsive Sidebar With jQuery and Hammer.js | Fxp Sidebar

Fxp Jquery Sidebar is a simple plugin from jQuery to create responsive, animated, easy-to-touch, multi-level navigation (hamburger navigation, off-the-canvas menu, and sidebar) on the modern web app.

Hammer.js library is required to provide tactile support in navigating the drawer. Compatible with the latest Bootstrap framework. Easy to implement on your existing project without writing any JavaScript or CSS.

How to make use of it:

1. Load the core stylesheet sidebar.css within the head part.

<link href="./dist/sidebar.css" rel="stylesheet">

2. Load the sidebar-bootstrap.css if you would like to make use of the plugin within Bootstrap.

<link href="./dist/sidebar-bootstrap.css" rel="stylesheet">

3. Load the Font Awesome Iconic Font for the hamburger toggle button.

<link rel="stylesheet" href="/path/to/fontawesome/css/all.css">

4. Load the necessary jQuery, hammer.js, and sidebar.js files on the finish of the HTML doc.

<script src="/path/to/cdn/jquery.min.js"></script>
<script src="/path/to/cdn/hammer.min.js"></script>
<script src="./dist/sidebar.js" async="async"></script>

5. The primary HTML structure to create drawer navigation.

<div class="fxp-sidebar fxp-sidebar-default" data-sidebar="true" data-toggle-id="sidebar-toggle-left">
  <ul class="fxp-sidebar-menu">
    <li class="fxp-sidebar-group"><span>Header 1</span>
      <ul class="fxp-sidebar-group-menu">
        <li class="fxp-sidebar-item"><a href="#">Item 1</a></li>
        <li class="fxp-sidebar-item"><a href="#" class="active">Item 2</a></li>
        <li class="fxp-sidebar-item"><a href="#">Item 3</a></li>
    <li class="fxp-sidebar-group"><span>Header 2</span>
        <ul class="fxp-sidebar-group-menu">
            <li class="fxp-sidebar-item"><a href="#">Item 4</a></li>
            <li class="fxp-sidebar-item"><a href="#">Item 5</a></li>
            <li class="fxp-sidebar-item"><a href="#">Item 6</a></li>
    <li class="fxp-sidebar-item"><a href="#">Item 7</a></li>
    <li class="fxp-sidebar-item"><a href="#">Item 8</a></li>
    <li class="fxp-sidebar-item"><a href="#">Item 9</a></li>
    <li class="fxp-sidebar-item"><a href="#">Item 10</a></li>

6. Create a toggle button to open/close the drawer navigation.

<script src="/path/to/cdn/jquery.min.js"></script>
<script src="/path/to/cdn/hammer.min.js"></script>
<script src="./dist/sidebar.js" async="async"></script>

Touch-friendly Drawer Navigation Plugin, Fxp Jquery Sidebar Github

See Demo And Download

Official Website(fxpio): Click Here

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


You may also like...

Leave a Reply

Your email address will not be published.