Slide and Push Menu Transitions With Vanilla Javascript | slidemenu

Slidemenu is the minimalist off-canvas push navigation, which reveals the list of the sidebar while pushing the main content to the right. Built with CSS and a little JavaScript.

multi level push menu, push menu css, react multi level push menu, push menu plugin, slide and push menus with css3 transitions, multi level menu examples

How to make use of it:

1. Create a hamburger list button with the side menu on the web page.

<span class="open-side">
  <a href="#" onclick="openSideMenu()">
    <svg width="30" height="30">
      <path d="M0,5 30,5" stroke="#fff" stroke-width="5"/>
      <path d="M0,14 30,14" stroke="#fff" stroke-width="5"/>
      <path d="M0,23 30,23" stroke="#fff" stroke-width="5"/>
    </svg>
  </a>
</span>
<div id="side-menu" class="side-nav">
  <a href="#" class="btn-close" onclick="closeSideMenu()">&times;</a>
  <a href="#">Home</a>
  <a href="#">About</a>
  <a href="#">Services</a>
  <a href="#">Contact</a>
</div>

2. Enter your main content in the document.

<div id="main">
  <h1>Side Menu</h1>
</div>

3. Basic CSS patterns.

.side-nav {
  height: 100%;
  width: 0;
  position: fixed;
  z-index: 1;
  top: 0;
  left: 0;
  background-color: #111;
  opacity: 0.9;
  overflow-x: hidden;
  padding-top: 60px;
  transition: 0.5s;
}
.side-nav a {
  padding: 10px 10px 10px 30px;
  text-decoration: none;
  font-size: 22px;
  color: #ccc;
  display: block;
  transition: 0.3s;
}
.side-nav a:hover { color: #008080; }
.side-nav .btn-close {
  position: absolute;
  top: 0;
  right: 22px;
  font-size: 36px;
  margin-left: 50px;
}
#main {
  transition: margin-left 0.5s;
  padding: 20px;
  overflow: hidden;
  width: 100%;
}

4. The main javascript to switch CSS chapters while opening/closing the side menu.

function openSideMenu(){
  document.getElementById('side-menu').style.width ='250px';
  document.getElementById('main').style.marginLeft ='250px';
}
function closeSideMenu(){
  document.getElementById('side-menu').style.width ='0';
  document.getElementById('main').style.marginLeft ='0';
}

minimalist side push menu, slidemenu Plugin/Github


See Demo And Download

Official Website(nigeljaure): Click Here

This superior jQuery/javascript plugin is developed by nigeljaure. For extra advanced usage, 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…