OFF CANVAS MENU
How do I make an off canvas menu?
Creating a slide out menu which sites below a top header. Uses calc to make the height of the menu.. What is a off canvas menu? How do you make a off canvas menu? This script and codes were developed by Luke Watts on 14 October 2022, Friday.
OFF CANVAS MENU - Script Codes HTML Codes
<!DOCTYPE html>
<html >
<head> <meta charset="UTF-8"> <title>OFF CANVAS MENU</title> <link rel="stylesheet" href="https://cdnjs.cloudflare.com/ajax/libs/normalize/5.0.0/normalize.min.css"> <link rel="stylesheet" href="css/style.css">
</head>
<body>
<header class="header" role="banner"> <div class="masthead"><a class="home-link logo" href="#"> <div class="nav-menu-button icon icon-bars" id="header-mobile-button"></div></a><a class="branding" href="#">OFF CANVAS MENU</a></div>
</header>
<nav class="main-nav" role="navigation"> <ul class="main-nav-menu"> <li class="main-nav-menu-item"><a class="main-nav-menu-item-link" href="#">Home</a></li> <li class="main-nav-menu-item"><a class="main-nav-menu-item-link" href="#">About</a></li> <li class="main-nav-menu-item"><a class="main-nav-menu-item-link" href="#">News</a></li> <li class="main-nav-menu-item"><a class="main-nav-menu-item-link" href="#">Contact</a></li> <li class="main-nav-menu-item"><a class="main-nav-menu-item-link" href="#">Sign Up</a></li> </ul>
</nav> <script src='http://cdnjs.cloudflare.com/ajax/libs/jquery/2.1.3/jquery.min.js'></script>
<script src='http://use.fonticons.com/25e3cc81.js'></script> <script src="js/index.js"></script>
</body>
</html>
OFF CANVAS MENU - Script Codes CSS Codes
.header, .main-nav { font-size: 1rem;
}
.header { line-height: 3rem; padding: 0 1rem; font-family: "Helvetica Neue Light", "Helvetica Neue", Helvetica, Arial, "Lucida Grande", sans-serif; background-color: #26343F;
}
.home-link, .branding { color: white; text-decoration: none;
}
.branding { margin-left: 1rem;
}
.main-nav { width: 320px; height: calc(100vh - 3rem); position: relative; -webkit-transition: 300ms ease; transition: 300ms ease; -webkit-transform: translateX(-320px); transform: translateX(-320px); background-color: #1c272f;
}
.main-nav.open { -webkit-transform: translateX(0); transform: translateX(0);
}
.main-nav-menu { margin: 0; list-style: none; padding-top: 0.5rem; padding-bottom: 0.5rem;
}
.main-nav-menu-item { padding-top: 0.5rem; padding-bottom: 0.5rem;
}
.main-nav-menu-item-link { color: white; text-decoration: none;
}
OFF CANVAS MENU - Script Codes JS Codes
jQuery(document).ready(function() { jQuery('#header-mobile-button').on('click', function(event) { event.preventDefault(); jQuery('.main-nav').toggleClass('open'); });
});
Developer | Luke Watts |
Username | lukewatts |
Uploaded | October 14, 2022 |
Rating | 3 |
Size | 3,206 Kb |
Views | 40,480 |
Find the perfect freelance services for your business! Fiverr's mission is to change how the world works together. Fiverr connects businesses with freelancers offering digital services in 500+ categories. Find Developer!
Name | Size |
Christmas Countdown | 3,948 Kb |
Custom Google Maps | 5,076 Kb |
AFFINITY4 SERVICES ANIMATION | 2,902 Kb |
Webkit Background Text Clip | 2,808 Kb |
CSS Dark Neon LED Volume Dial | 3,893 Kb |
SmartQRTravel Login Form | 4,102 Kb |
HUD Animation Test | 4,015 Kb |
Sass Get Function | 2,155 Kb |
A Pen by Luke Watts | 1,723 Kb |
Turnable LED Dial | 5,472 Kb |
Jasper is the AI Content Generator that helps you and your team break through creative blocks to create amazing, original content 10X faster. Discover all the ways the Jasper AI Content Platform can help streamline your creative workflows. Start For Free!
Name | Username | Size |
Update CSS Variables with JS | Wesbos | 2,335 Kb |
Test | Dviate | 2,668 Kb |
Hovers with popups | Zacharyolson | 2,380 Kb |
Simple Accordion | Wearebold | 3,683 Kb |
ABVI Menu Discarded | Overdrivemachines | 3,607 Kb |
Pure CSS Torch Light | Juliendargelos | 2,727 Kb |
Simple content swap | Snografx | 1,859 Kb |
To Do List with Delete | Mattlbrody | 2,068 Kb |
CSS3 Selectables with information rollover | Jasonmayes | 9,565 Kb |
Example SVGZ Data URI | Joeyhoer | 2,981 Kb |
Surf anonymously, prevent hackers from acquiring your IP address, send anonymous email, and encrypt your Internet connection. High speed, ultra secure, and easy to use. Instant setup. Hide Your IP Now!