Collapsible menu using CSS transitions
How do I make an collapsible menu using css transitions?
Using CSS transitions with cubic-bezier easing to produce a bouncy effect.. What is a collapsible menu using css transitions? How do you make a collapsible menu using css transitions? This script and codes were developed by Aurer on 03 August 2022, Wednesday.
Collapsible menu using CSS transitions - Script Codes HTML Codes
<!DOCTYPE html>
<html >
<head> <meta charset="UTF-8"> <title>Collapsible menu using CSS transitions</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> <div class="page"> <h1>Collapsible menu using CSS transitions</h1> <nav class="crumbs"> <button>Menu (up to 5 items)</button> <ul> <li><a href="">Suspendisse feugiat</a></li> <li><a href="">In auctor lobortis lacus</a></li> <li><a href="">Fusce ac felis sit amet ligula</a></li> <li><a href="">Fusce neque</a></li> <li><span>In ac felis quis tortor malesuada pretium</span></li> </ul> </nav> <nav class="crumbs alternating"> <button>Menu</button> <ul> <li><a href="">Suspendisse feugiat</a></li> <li><a href="">In auctor lobortis lacus</a></li> <li><a href="">Fusce ac felis sit amet ligula</a></li> <li><a href="">Fusce neque</a></li> <li><a href="">Suspendisse feugiat</a></li> <li><a href="">In auctor lobortis lacus</a></li> <li><a href="">Fusce ac felis sit amet ligula</a></li> <li><a href="">Fusce neque</a></li> <li><span>In ac felis quis tortor malesuada pretium</span></li> </ul> </nav>
</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>
Collapsible menu using CSS transitions - Script Codes CSS Codes
body { background: #eee; padding: 1em;
}
.page { max-width: 600px; margin: auto;
}
.crumbs { margin-bottom: 1em;
}
.crumbs button { background: #015581; color: #fff; border: none; padding: .5em; outline: none;
}
.crumbs button:after { content: " \25BC";
}
.crumbs.active button:after { content: " \25B2";
}
.crumbs ul { padding: 0; margin: 0;
}
.crumbs li { list-style: none; background: #009FD6; padding: 0 .5em; padding-right: 25px; color: #fff; position: relative; line-height: 0; -webkit-transition: all 0.2s cubic-bezier(0.6, -0.28, 0.735, 0.045); transition: all 0.2s cubic-bezier(0.6, -0.28, 0.735, 0.045);
}
.crumbs.active li { padding-top: .5em; padding-bottom: .5em; line-height: 1.2; -webkit-transition: all 0.2s cubic-bezier(0.06, 0.91, 0.23, 1.435); transition: all 0.2s cubic-bezier(0.06, 0.91, 0.23, 1.435);
}
.crumbs li a,
.crumbs li span { color: inherit; text-decoration: none; display: block; white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
.crumbs li:after { content: ''; border: 0px solid transparent; border-width: 0px; border-top-color: #009FD6; position: absolute; bottom: 0; right: 15px; z-index: 10; -webkit-transition: all 0.2s cubic-bezier(0.6, -0.28, 0.735, 0.045); transition: all 0.2s cubic-bezier(0.6, -0.28, 0.735, 0.045);
}
.crumbs li:nth-child(2) { background: #0088b7;
}
.crumbs li:nth-child(2):after { border-top-color: #0088b7;
}
.crumbs li:nth-child(3) { background: #007299;
}
.crumbs li:nth-child(3):after { border-top-color: #007299;
}
.crumbs li:nth-child(4) { background: #005b7a;
}
.crumbs li:nth-child(4):after { border-top-color: #005b7a;
}
.crumbs li:nth-child(5) { background: #00445c;
}
.crumbs li:nth-child(5):after { border-top-color: #00445c;
}
.crumbs li:last-child:after { border: none;
}
.crumbs.alternating li:nth-child(2n+1) { background: #009FD6;
}
.crumbs.alternating li:nth-child(2n+1):after { border-top-color: #009FD6;
}
.crumbs.alternating li:nth-child(2n) { background: #0088b7;
}
.crumbs.alternating li:nth-child(2n):after { border-top-color: #0088b7;
}
.crumbs.active li:after { border-width: 15px; bottom: -29px; right: 1px; -webkit-transition: all 0.2s cubic-bezier(0.06, 0.91, 0.23, 1.435); transition: all 0.2s cubic-bezier(0.06, 0.91, 0.23, 1.435);
}
Collapsible menu using CSS transitions - Script Codes JS Codes
// Toggle class to show menu
$('.crumbs button').on('click', function(){ $(this).parent().toggleClass('active');
})
// Show the menus just for the demo
$('.crumbs').each(function(i,o){ setTimeout(function(){ $(o).addClass('active'); }, (i+1)*500);
})
![Collapsible menu using CSS transitions - Script Codes](http://shots.codepen.io/aurer/pen/QwwdzR-512.jpg)
Developer | Aurer |
Username | aurer |
Uploaded | August 03, 2022 |
Rating | 3 |
Size | 3,333 Kb |
Views | 46,552 |
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 Aurer | 3,919 Kb |
Learning canvas drawing | 2,204 Kb |
Vue form theme | 3,755 Kb |
ERC Search panels mockup | 4,970 Kb |
JS Gradient | 3,400 Kb |
Letter fountain | 2,607 Kb |
Simple normalised button style | 2,267 Kb |
Super Clock | 6,256 Kb |
Fixed banners and parallax backgrounds | 3,526 Kb |
Webkit CSS Scrollbars | 3,180 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 |
Basic jQuery Filter list | Mtedwards | 2,464 Kb |
Mondrian | Chrisarmstrong | 2,787 Kb |
Impress JS Algorhytmic Generator | Jeffscottward | 7,906 Kb |
Rain Landing in a Pond | Edball | 3,009 Kb |
Countdown with Rings | Ewganoel | 2,490 Kb |
IbrahimJabbari-Effect14 | Ibrahimjabbari | 1,919 Kb |
Css color for svg | Ademilter | 2,392 Kb |
Heatmap Color Scales | Stevepepple | 2,331 Kb |
A Pen by tugce | Ecgutcnkr | 4,197 Kb |
Masonry | Uriuriuriu | 5,005 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!