Dropdown Menu Animation
How do I make an dropdown menu animation?
Fancy, little animation for a dropdown menu or list. Using CSS3 animations and jQuery.. What is a dropdown menu animation? How do you make a dropdown menu animation? This script and codes were developed by Karsten Buckstegge on 10 September 2022, Saturday.
Dropdown Menu Animation - Script Codes HTML Codes
<!DOCTYPE html>
<html >
<head> <meta charset="UTF-8"> <title>Dropdown Menu Animation</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> <html lang="en">
<head> <meta charset="UTF-8" /> <title>Drop Menu</title> <link href='https://fonts.googleapis.com/css?family=Open+Sans:300' rel='stylesheet' type='text/css'>
</head>
<body> <p class="commander">Click the Button!</p> <div class="wrapper"> <div class="menu"> <ul class="menu__list"> <li class="menu__list__item"><a href="#">Home</a></li> <li class="menu__list__item"><a href="#">Portfolio</a></li> <li class="menu__list__item"><a href="#">About</a></li> </ul> </div> <div class="button"> <span class="button__line"></span> <span class="button__line"></span> <span class="button__line"></span> </div> </div>
</body>
</html> <script src='http://cdnjs.cloudflare.com/ajax/libs/jquery/2.1.3/jquery.min.js'></script> <script src="js/index.js"></script>
</body>
</html>
Dropdown Menu Animation - Script Codes CSS Codes
@-webkit-keyframes drop { from { top: 0px; } 70% { top: 165px; -webkit-animation-timing-function: ease-in; animation-timing-function: ease-in; } to { top: 150px; -webkit-animation-timing-function: ease-out; animation-timing-function: ease-out; }
}
@keyframes drop { from { top: 0px; } 70% { top: 165px; -webkit-animation-timing-function: ease-in; animation-timing-function: ease-in; } to { top: 150px; -webkit-animation-timing-function: ease-out; animation-timing-function: ease-out; }
}
html { width: 100%; height: 100%; background: -webkit-radial-gradient(center, #ffffff 0%, #cccccc 70%, #cccccc 100%) no-repeat; background: radial-gradient(center, #ffffff 0%, #cccccc 70%, #cccccc 100%) no-repeat;
}
body { display: -webkit-box; display: -ms-flexbox; display: flex; -ms-flex-wrap: wrap; flex-wrap: wrap;
}
.commander { width: 100%; color: #2E3F47; font-size: 1.5em; font-family: 'Open Sans', sans-serif; text-align: center;
}
.wrapper { position: relative; width: 150px; height: 150px; margin: 10px auto;
}
.button { display: -webkit-box; display: -ms-flexbox; display: flex; position: absolute; top: 0; width: 100%; height: 100%; -webkit-box-orient: vertical; -webkit-box-direction: normal; -ms-flex-direction: column; flex-direction: column; -webkit-box-align: center; -ms-flex-align: center; align-items: center; -webkit-box-pack: center; -ms-flex-pack: center; justify-content: center; border-radius: 50%; background: #2E3F47; z-index: 2;
}
.button__line { background: #ccc; width: 90px; height: 15px;
}
.button__line:not(:first-child) { margin-top: 15px;
}
.menu { width: 100%;
}
.menu__list { text-align: center; width: 100%; padding-left: 0;
}
.menu__list__item { position: relative; list-style: none; padding-bottom: 15px; top: 0px;
}
.menu__list__item a { text-decoration: none; color: grey; text-align: center; font-size: 1.5em; font-family: 'Open Sans', sans-serif;
}
.menu__list__item { opacity: 0;
}
.menu__list--animate .menu__list__item { -webkit-animation: drop 0.9s; animation: drop 0.9s; -webkit-animation-fill-mode: forwards; animation-fill-mode: forwards; opacity: 1;
}
.menu__list--animate .menu__list__item:nth-child(2) { -webkit-animation-delay: 0.5s; animation-delay: 0.5s;
}
.menu__list--animate .menu__list__item:nth-child(3) { -webkit-animation-delay: 1s; animation-delay: 1s;
}
Dropdown Menu Animation - Script Codes JS Codes
// function to trigger animation
document.querySelector('.button').addEventListener('click', () => { document.querySelector('.menu__list') .classList.toggle('menu__list--animate');
});
Developer | Karsten Buckstegge |
Username | MrBambule |
Uploaded | September 10, 2022 |
Rating | 4.5 |
Size | 3,411 Kb |
Views | 68,816 |
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 |
SeXy buttons | 4,447 Kb |
Even More Brokener TV | 2,571 Kb |
Broken TV | 2,456 Kb |
CSS3 Hover Button | 3,717 Kb |
Responsive CSS arrow bar with transparent borders | 2,798 Kb |
Sliding Skill-Diagramm | 2,466 Kb |
Simple React Slider | 4,975 Kb |
The wheel of social | 4,072 Kb |
Base64 SVG Me | 44,786 Kb |
The wheel of social fortune | 6,570 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 |
Starting out with Ember.JS | Cfleschhut | 4,808 Kb |
Rainbow Drops | Csbarnes | 2,365 Kb |
Price | Catcode | 2,623 Kb |
3D-box | Parthviroja | 2,346 Kb |
Button shaking | SusanneLundblad | 2,227 Kb |
Two joint circles - One element | Berdejitendra | 1,704 Kb |
Animate elements with fixed gradient | Badabam | 4,406 Kb |
Very Simple Slider | Doodlemarks | 2,682 Kb |
Animating characters with jQuery | 042 | 2,776 Kb |
SVG Scalable Text | Said_FD | 1,451 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!