Animated Sliding Hamburger Navbar With jQuery And CSS

The animated sidebar css project takes advantage of jQuery and CSS / CSS3 to create an animated hamburger toggle that slides out of the horizontal navigation bar when clicked.

jquery hamburger menu, jquery hamburger menu responsive, hamburger menu css responsive, jquery hamburger menu plugin, bootstrap left slide menu example

How to make use of it:

1. Add the hamburger toggle and your menu listing to the navbar.

<div class="menu">
  <span class="toggle">
    <i></i>
    <i></i>
    <i></i>
  </span>
  <div class="menuContent">
    <ul>
      <li>Home</li>
      <li>About</li>
      <li>Contact</li>
      <li>Blog</li>
      <li>About us</li>
    </ul>
  </div>
</div>

2. The core CSS types for the navbar.

.menu {
  height: 70px;
  width: 70px;
  right: 70px;
  top: 20px;
  text-align: center;
  position: absolute;
  background: #fafafa;
  overflow: hidden;
  transition: all 0.2s ease;
  z-index: 999;
}

.menu.active {
  width: calc(100% - 140px);
}

.menu.active .menuContent * {
  opacity: 1;
}

.menu .menuContent {
  position: absolute;
  width: 100%;
  height: 100%;
  line-height: 40px;
  right: 0px;
  text-align: center;
}

.menu .menuContent * {
  opacity: 0;
}

.menu .menuContent ul li {
  display: inline-block;
  margin-left: 50px;
  margin-right: 50px;
  color: #2d3235;
  transition: opacity 0.3s ease 0.3s;
  cursor: pointer;
  position: relative;
}

.menu .menuContent ul li:hover:before {
  opacity: 0.8;
  top: 13px;
  left: 20px;
}

.menu .menuContent ul li:hover:after {
  opacity: 0.8;
  bottom: 13px;
  left: -20px;
}

.menu .menuContent ul li:before, .menu .menuContent ul li:after {
  content: "";
  position: absolute;
  width: 20px;
  height: 2px;
  background: #ccc;
  transition: all 0.3s ease;
}

.menu .menuContent ul li:before {
  transform: rotate(-55deg);
  left: 60px;
  top: -30px;
  opacity: 0;
  right: 0;
  margin: auto;
}

.menu .menuContent ul li:after {
  transform: rotate(-55deg);
  left: -60px;
  bottom: -30px;
  opacity: 0;
  right: 0;
  margin: auto;
}

3. Style the hamburger menu toggle.

.menu.active span i:nth-child(1) {
  transform: rotate(-45deg) translate(-50%, -50%);
  top: 50%;
}

.menu.active span i:nth-child(2) {
  transform: translateX(-100px);
  opacity: 0;
}

.menu.active span i:nth-child(3) {
  transform: rotate(45deg) translate(-50%, -50%);
  top: 50%;
}

.menu span {
  width: 70px;
  height: 70px;
  position: absolute;
  right: 0;
  cursor: pointer;
  background: #fafafa;
  z-index: 1;
}

.menu span i {
  position: absolute;
  transform-origin: 50% 50%;
  width: 45%;
  height: 2px;
  left: 0;
  right: 0;
  margin: auto;
  background-color: #ccc;
  transition: transform 0.3s ease, opacity 0.1s ease 0.1s;
}

.menu span i:nth-child(1) {
  top: 40%;
}

.menu span i:nth-child(2) {
  top: 50%;
}

.menu span i:nth-child(3) {
  top: 60%;
}

4. The core JavaScript to allow the hamburger navbar. Copy and paste the following JS snippets after the jQuery library and completed them.

<script src="/path/to/cdn/jquery.slim.min.js"></script>
$('.toggle').on('click', function() {
  $('.menu').toggleClass('active');
});

Sliding Hamburger Navbar, animated sidebar css jquery Plugin/Github, hamburger menu css only, slide menu jquery, bootstrap hamburger menu


See Demo And Download

Official Website(mrakhmadjon): Click Here

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

Related Posts

HStack-and-VStack-in-CSS

CSS Layout Components Horizontal/Vertical Stack | HStack and VStack

HStack and VStack in CSS – CSS layout components that (basically) stack anything horizontally and vertically. A pure CSS library that makes it easy to stack elements…

Floating-Whatsapp-Chat-Button

How to Add Floating Whatsapp Chat Button In HTML | venom-button

Venom Button is a very simple plugin for the jQuery floating WhatsApp button. Adds a floating button to your site that calls WhatsApp Click to Chat API. It will automatically start the WhatsApp…

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…

alert-confirm-prompt-attention-js

Simple Alert, Confirm, Prompt Popup Using Vanilla JavaScript Library | attention.js

JavaScript provides various built-in functionality to display popup messages for different purposes. Attention JS is a vanillaJS plugin used to create a custom alert, confirm, or Prompt…

Bootstrap-4-Sidebar-Menu-Responsive-Template

Bootstrap 4 Sidebar Menu Responsive Template | MDB

Bootstrap Side Navbar – Responsive sidebar template based on the Bootstrap 4 framework. An easy-to-use, totally responsive, Google Material Design impressed aspect navigation for modern web app…

Bootstrap-4-Toast-Notification-Plugin

Lightweight Bootstrap 4 Toast Notification Plugin | BS4 Advanced Toast

A lightweight Bootstrap 4 Toast Notification plugin integrated with JS/jQuery. bs4-toast.js is a JavaScript library that enhances the native Bootstrap toast component with icons, buttons, callbacks, and…

Leave a Reply

Your email address will not be published. Required fields are marked *