Toggle menu
How do I make an toggle menu?
What is a toggle menu? How do you make a toggle menu? This script and codes were developed by Susanne Karin Lundblad on 13 September 2022, Tuesday.
Toggle menu - Script Codes HTML Codes
<!DOCTYPE html>
<html >
<head> <meta charset="UTF-8"> <title>Toggle menu</title> <link rel="stylesheet" href="css/style.css">
</head>
<body> <nav id="menu"> <h3>Menu</h3> <a href="#">Banana page</a> <a href="#">Aple page</a> <a href="#">Kiwi page</a> <a href="#">Orange page</a>
</nav>
<div class="contnent"> <h1>Toggle that menu!</h1> <button class="toggle-btn">Toggle menu</button>
</div> <script src='http://cdnjs.cloudflare.com/ajax/libs/jquery/2.1.3/jquery.min.js'></script> <script src="js/index.js"></script>
</body>
</html>
Toggle menu - Script Codes CSS Codes
body { position: relative; left: 0;
}
body.hasMenu { left: -240px;
}
h1,
h3,
a,
p,
*:before { font-family: "Helvetica Neue", sans-serif; font-weight: 300;
}
h1 { color: #3498db;
}
button { position: absolute; right: 0; top: 0; border: 0; background-color: #3498db; color: #fff; border-radius: 4px; padding: 5px 10px; transition: background-color 0.2s ease-out; cursor: pointer; box-shadow: 0 2px 0 #217bb8;
}
button:hover { background-color: #2980b9; box-shadow: 0px 2px 0 #1a6293;
}
button:active,
button:hover,
button:focus { outline: none;
}
button:active { transform: translateY(1px); box-shadow: 0 1px 0 #1a6293;
}
#menu { background: #47a3da; position: fixed; width: 240px; height: 100%; top: 0; z-index: 1000; right: -240px;
}
.hasMenu #menu { right: 0;
}
#menu a { display: block; color: #fff; font-size: 1.1em; font-weight: 300; text-decoration: none; line-height: 1.5; border-bottom: 1px solid #258ecd; padding: 1em;
}
#menu h3 { color: #afdefa; font-size: 1.9em; padding: 20px; margin: 0; font-weight: 300; background: #0d77b6; margin-bottom: 1rem;
}
body,
#menu { -webkit-transition: all 0.3s ease; -moz-transition: all 0.3s ease; transition: all 0.3s ease;
}
Toggle menu - Script Codes JS Codes
$(".toggle-btn").on("click", function() { $("body").toggleClass("hasMenu");
});
Developer | Susanne Karin Lundblad |
Username | SusanneLundblad |
Uploaded | September 13, 2022 |
Rating | 3 |
Size | 2,892 Kb |
Views | 32,384 |
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 |
CSS-masking gallery | 2,567 Kb |
Css grid | 2,250 Kb |
A Pen by Susanne Karin Lundblad | 2,320 Kb |
Hover-effect | 3,241 Kb |
Css man | 3,712 Kb |
AngularJS, submitting from input pushing enter | 2,219 Kb |
Flying pinata | 3,560 Kb |
Floating element with shadow | 1,783 Kb |
Susie | 2,797 Kb |
Getting username from email adress | 3,443 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 |
Weird glowy CSS3 game | Toneworm | 3,684 Kb |
CSS Variables | Jdsteinbach | 4,759 Kb |
The Fantastic Mr Fox | MalZiiirA | 10,435 Kb |
Classy Blockquote Styling | Andrewwright | 3,212 Kb |
Canvas snow | Win7killer | 2,572 Kb |
Canvas stripes | Adrianparr | 1,948 Kb |
Modal Dialog | Gigaleet | 2,251 Kb |
Animate a paper plane along an SVG path, looking ahead | PotatoDie | 3,734 Kb |
Pure CSS read more toggle | Idered | 2,344 Kb |
Process Accordion | Devilskitchen | 31,432 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!