Responsive Expanding Sidebar Hamburger Menu | Shy Menu

Shy Menu is a jQuery script to create a hamburger toggle icon that expands to a side menu panel with CSS3 transitions.

hamburger menu right side codepen, shy hamburger menu right, responsive sidebar hamburger menu, best responsive hamburger menu, how to remove hamburger menu

How to make use of it:

1. The HTML to create a corner menu with a hamburger toggle.

<div class="shy-menu">
  <a class="shy-menu-hamburger">
    <span class="layer top"></span>
    <span class="layer mid"></span>
    <span class="layer btm"></span>
    </a>
  <div class="shy-menu-panel">
    <ul>
      <li><a href="#">link 1</a></li>
      <li><a href="#">link 2</a></li>
      <li><a href="#">link 3</a></li>
    </ul>
  </div>
</div>

<div class="menu open">
  <a class="hamburger">
    <span class="layer top"></span>
    <span class="layer mid"></span>
    <span class="layer btm"></span>
  </a>
</div>

2. CSS/CSS3 styles required for the shy menu.

* {
  -moz-transition: all .4s cubic-bezier(.1,.7,.3,1);
  -webkit-transition: all .4s cubic-bezier(.1,.7,.3,1);
  -o-transition: all .4s cubic-bezier(.1,.7,.3,1);
  -ms-transition: all .4s cubic-bezier(.1,.7,.3,1);
  transition: all .4s cubic-bezier(.1,.7,.3,1);
}

ul {
  list-style: none;
  margin: 0 0 0 15px;
  padding: 0;
}

.shy-menu { 
  display: block;
  height: 35px;
  padding: 5px;
  width: 35px;
  
  background-color: rgba(33,40,44,.1);
  border-bottom-right-radius: 10px;
  color: #fff;
}
.shy-menu.is-open,
.shy-menu:hover { 
  background-color: rgba(33,40,44,1);
}

.shy-menu.is-open {
  height: 150px;
  width: 100px;
}

.shy-menu-panel { 
  margin-left: -100px;
}
.is-open .shy-menu-panel { 
  margin-left: 0;
}

3. Style and animate hamburgers with CSS3 transformations.

.shy-menu-hamburger {
  position: relative;
  left: 0;
  top: 0;
  width: 54px;
  height: 54px;
  display: block;
  overflow: hidden;
  cursor: pointer;
}

.shy-menu-hamburger > .layer {
  background-color: #fff;
  border-radius: 1px;
  display: block;
  height: 2px;
  overflow: hidden;
  position: absolute;
    left: 5px;
  width: 18px;
}

.shy-menu-hamburger .layer.top { top: 9px; }
.is-open .shy-menu-hamburger .layer.top { 
  top: 17px;
  left: 5px;
  transform: rotate(45deg);
}
.shy-menu-hamburger .layer.mid { top: 16px; }
.is-open .shy-menu-hamburger .layer.mid {
  opacity: 0;
  left: 0;
}
.shy-menu-hamburger .layer.btm { top: 23px; }
.is-open .shy-menu-hamburger .layer.btm { 
  top: 17px;
  left: 5px;
  transform: rotate(-45deg);
}

4. Download the latest jQuery JavaScript library from the CDN.

<script src="//code.jquery.com/jquery-1.11.2.min.js"></script>

5. Activate the shy menu with the following JavaScript snippets.

$(function() {
  
  initDropDowns($("div.shy-menu"));

});

function initDropDowns(allMenus) {

  allMenus.children(".shy-menu-hamburger").on("click", function() {
    
    var thisTrigger = jQuery(this),
      thisMenu = thisTrigger.parent(),
      thisPanel = thisTrigger.next();

    if (thisMenu.hasClass("is-open")) {

          thisMenu.removeClass("is-open");
      
          jQuery(document).off("click");                                 
          thisPanel.off("click");

    } else {      
      
        allMenus.removeClass("is-open");  
      thisMenu.addClass("is-open");
  
      jQuery(document).on("click", function() {
        allMenus.removeClass("is-open");
      });
      thisPanel.on("click", function(e) {
        e.stopPropagation();
      });
    }
    
    return false;
  });
}

jQuery/CSS3 Based Expanding Hamburger Menu, Shy menu Plugin/Github


See Demo And Download

Official Website(scavaille): Click Here

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

Related Posts

Google-Translate-Dropdown-Customize-With-Country-Flag

Google Translate Dropdown Customize With Country Flag | GT API

Flag google translates jQuery text that takes advantage of the Google Cloud Translation API to translate web content between languages by selecting a country from the dropdown…

Bootstrap-Fileinput

HTML 5 File Input Optimized for Bootstrap 4.x./3.x with File Preview | Bootstrap Fileinput

bootstrap-fileinput is an improved HTML 5 file input  Bootstrap 5.x, 4.x and 3.x with file preview for different files, provides multiple selections, resumable section uploads, and more….

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…

Leave a Reply

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