Create websites with TailwindCSS
Design blocks for your website
Start building the next great SAAS
Alpine & Tailwind UI Library
Plug'n Play Authentication for Laravel
Create website designs with AI
Blog platform for developers
Build a simple static website
21-day program to build a SAAS
Upgrade your account to get access to all content.
Created on March 22nd, 2016
Using this CSS library you can easily add awesome CSS Hamburger buttons to your pages. It's as simple as including the CSS and a little bit of Javascript and you are good to go.
Demo Page: https://jonsuh.com/hamburgers/
Github Page: https://github.com/jonsuh/hamburgers
Here is the code the file we used in the video.
<!DOCTYPE html>
<html>
<head>
<title>HAMBURGER</title>
<link rel="stylesheet" type="text/css" href="hamburgers.min.css">
</head>
<body>
<button class="hamburger hamburger--elastic" style="outline:none" type="button">
<span class="hamburger-box">
<span class="hamburger-inner"></span>
</span>
</button>
<script>
// Look for .hamburger
var hamburger = document.querySelector(".hamburger");
// On click
hamburger.addEventListener("click", function() {
// Toggle class "is-active"
hamburger.classList.toggle("is-active");
// Do something else, like open/close menu
});
</script>
</body>
</html>
Don't forget to download the CSS file from the links above and include it in your project folder.
273
Comments (0)