Menu Toggle
How do I make an menu toggle?
What is a menu toggle? How do you make a menu toggle? This script and codes were developed by Ashepherd1 on 29 November 2022, Tuesday.
Menu Toggle - Script Codes HTML Codes
<!DOCTYPE html>
<html >
<head> <meta charset="UTF-8"> <title>Menu Toggle</title> <link rel="stylesheet" href="css/style.css">
</head>
<body> <div class="wrapper"> <a class="menu-icon"> <span></span> <span></span> <span></span> </a> <div class="menu hidden"> <p>This is a menu.<p> <p>This is a menu.<p> <p>This is a menu.<p> <p>This is a menu.<p> <p>This is a menu.<p> <p>This is a menu.<p> <p>This is a menu.<p> <button class="btn-primary">Button.</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>
Menu Toggle - Script Codes CSS Codes
body { background: #D9D9D9; font-family: arial;
}
.wrapper { max-width: 375px; margin: auto; background: white; height: 100vh; border: 1px solid silver;
}
.menu { width: 300px; padding: 10px; float: left; clear: both; border: 1px solid black;
}
.hidden { opacity: 0;
}
.menu-icon { width: 35px; height: 31px; padding: 10px; border: 1px solid #3e3e3e; float: left; position: relative; background: #FFFFFF;
}
.menu-icon span { width: 35px; height: 3px; background: black; margin-bottom: 4px; position: absolute; transition: all 200ms ease; transform-origin: center center;
}
.menu-icon span:nth-of-type(1) { top: 16px;
}
.menu-icon span:nth-of-type(2) { top: 24px;
}
.menu-icon span:nth-of-type(3) { top: 32px;
}
.menu-icon.nav-open span:nth-of-type(1) { transform: translate(0, 8px) rotate(45deg); -webkit-transform: translate(0, 8px) rotate(45deg); -ms-transform: translate(0, 8px) rotate(45deg); transition: all 200ms ease; transform-origin: center center;
}
.menu-icon.nav-open span:nth-of-type(2) { background: white; opacity: 0; transition: all 8ms ease; transform-origin: center center;
}
.menu-icon.nav-open span:nth-of-type(3) { transform: translate(0, -8px) rotate(-45deg); -webkit-transform: translate(0, -8px) rotate(-45deg); -ms-transform: translate(0, -8px) rotate(-45deg); transition: all 200ms ease; transform-origin: center center;
}
.menu p { margin: 35px 0 70px 0;
}
Menu Toggle - Script Codes JS Codes
$('.menu-icon').on('click', function () { $(this).toggleClass('nav-open');
});
$('.menu-icon').on('click', function () { $('.menu').toggleClass('hidden');
});
Developer | Ashepherd1 |
Username | ashepherd1 |
Uploaded | November 29, 2022 |
Rating | 3 |
Size | 2,635 Kb |
Views | 14,168 |
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 |
A Pen by ashepherd1 | 22,528 Kb |
GR TYM | 4,471 Kb |
DeferCuralate | 2,155 Kb |
Partially Responsive Content Layout | 2,450 Kb |
Image swap fade on hover. | 2,509 Kb |
MatchMedia JS Listener | 1,934 Kb |
Pattern Library | 5,332 Kb |
Fade Show Reveal by height | 2,568 Kb |
Lazy Sizes | 23,434 Kb |
Multiple modals from top at variable heights | 2,242 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 |
Vertically rotating text with CSS | Nopr | 2,141 Kb |
Improved Page Flipping Effect | Usaphp | 5,201 Kb |
Loading animation with css | Icebob | 2,947 Kb |
CSS Colors | Alexpate | 2,232 Kb |
Scroll to top button | DominicFrancois | 3,743 Kb |
Twitch.tv API | Ryzokuken | 2,618 Kb |
CSS Google Now | Jackmoran | 3,196 Kb |
A Pen by utcwebdev | Utcwebdev | 2,856 Kb |
Caputre Cam with JS | KimmoCommit | 2,795 Kb |
Menubar compass mixin | Michaelparenteau | 4,925 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!