filmov
tv
How to Create an Accordion with Vanilla JavaScript

Показать описание
====================
I'm back at it with my Let's Build: With JavaScript series. This week I take a stab at creating a custom accordion component with vanilla JavaScript.
An accordion is a useful component for dealing with a lot of extra content that doesn't necessarily always need to display. You might use an accordion to call out specific features of an application, show and hide content that isn't always important but is indeed useful to your given web design. I have even seen an entire F.A.Q. section built successfuly with accordions.
Much like the instrument an accordion shows and had panels when a given panel is active. In this video tutorial I'll teach you a vanilla JavaScript way of creating a simple accordion. Since we are spending some time crafting the interactions with JavaScript, I also wanted to make the accordion look good as well.
For this I reach for Tailwind CSS. Tailwind is a utility-driven CSS framework, useful for coding designs in a more scalable and resusable fashion. Sure, you can use custom styles or other frameworks just the same but they are rather opinionated approaches in some cases.
====================
💻 Previously published at:
💻 Check out the blog:
🦄 Check out my personal site:
🚀 Links:
📘Check out my book on UX Design:
"LUXD: Learn User Experience Design"
📙 Check out my FREE book on Tumblr Theming:
"Pro Tumblr Theming"
💯 Need awesome web hosting? Check out cloudways. They allow me to use a variety of hosting providers and build apps with ease:
🌊 Need more advanced hosting for Rails, PHP, Node, or other projects? Digital Ocean has you covered.
☕️ 🙏🏻 Patreon
☕️ Or buy me a coffee
Комментарии