Simple Hamburger Menu
How do I make an simple hamburger menu?
What is a simple hamburger menu? How do you make a simple hamburger menu? This script and codes were developed by Yang Li on 13 January 2023, Friday.
Simple Hamburger Menu - Script Codes HTML Codes
<!DOCTYPE html>
<html >
<head> <meta charset="UTF-8"> <title>Simple Hamburger Menu</title> <link rel="stylesheet" href="css/style.css">
</head>
<body> <div id="menu"> <div class="item one"><a href="">Home</a></div> <div class="item two"><a href="">About</a></div> <div class="item three"><a href="">Projects</a></div> <div class="item four"><a href="">Contact</a></div> <img id="burgerIcon" src="https://cdn4.iconfinder.com/data/icons/wirecons-free-vector-icons/32/menu-alt-512.png" alt="" />
</div>
<div id="hamburgerMenu"> <div class="dropdown one"><a href="">Home</a></div> <div class="dropdown two"><a href="">About</a></div> <div class="dropdown three"><a href="">Projects</a></div> <div class="dropdown four"><a href="">Contact</a></div>
</div> <script src="js/index.js"></script>
</body>
</html>
Simple Hamburger Menu - Script Codes CSS Codes
#menu { background-color: lightblue; display: flex; justify-content: flex-end;
}
.item { padding: 10px; font-size: 20px;
}
.item a { text-decoration: none;
}
#hamburgerMenu { background-color: lightblue; text-align: center; display: none
}
.dropdown { width: 100%; border: 1px dotted black; padding: 10px; font-size: 20px;
}
.dropdown a { text-decoration: none;
}
#burgerIcon { width: 30px; height: 30px; padding: 10px; cursor: pointer; display: none; transition: all .2s ease-in-out;
}
#burgerIcon:hover { transform: scale(1.5);
}
.one a { color: red;
}
.three a { color: red;
}
@media screen and (max-width: 600px) { .item { display: none; } #burgerIcon { display: flex; }
}
Simple Hamburger Menu - Script Codes JS Codes
var icon = document.getElementById("burgerIcon");
var dropdownItems = document.getElementById("hamburgerMenu");
icon.onclick = function() { if (dropdownItems.style.display == "none") { dropdownItems.style.display = "block"; } else { dropdownItems.style.display = "none"; }
}
Developer | Yang Li |
Username | aussieyang |
Uploaded | January 13, 2023 |
Rating | 3 |
Size | 2,099 Kb |
Views | 4,048 |
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 |
Battleships Starter | 2,429 Kb |
Fellowship of the Ring | 2,639 Kb |
Battleships Starter v2 | 2,283 Kb |
Birthday Party Starter | 1,629 Kb |
Responding Boxes | 1,943 Kb |
CSS Photoframe | 1,736 Kb |
Progress Bar | 2,261 Kb |
My Friends Starter | 1,573 Kb |
Battleships | 2,879 Kb |
Googly Eye | 2,468 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 |
JQuery Viewport Size | Jeffpannone | 2,317 Kb |
Filter inputs | Rowinf | 1,721 Kb |
Myprofile | SoufianeAbid | 2,451 Kb |
Next Word Predictor | Rfalor | 2,776 Kb |
Web SQL | Hoehoe | 1,983 Kb |
Michelle, submit your photography to Unsplash. | Zaneriley | 3,368 Kb |
Matrix | Stathisnikolaidis | 1,922 Kb |
A Pen by Malith Hettiarachchi | MalZiiirA | 5,531 Kb |
Shopping List | Markmurray | 6,015 Kb |
GLSL Hills | Ykob | 6,991 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!