Vertical Accordeon Menu

Size
2,226 Kb
Views
14,168

How do I make an vertical accordeon menu?

What is a vertical accordeon menu? How do you make a vertical accordeon menu? This script and codes were developed by Kévin Joffard on 11 October 2022, Tuesday.

Vertical Accordeon Menu Previews

Vertical Accordeon Menu - Script Codes HTML Codes

<!DOCTYPE html>
<html >
<head> <meta charset="UTF-8"> <title>Vertical Accordeon Menu</title> <link rel="stylesheet" href="css/style.css">
</head>
<body> <body> <nav> <ul> <li class="vertical-menu-item">ONE</li> <li class="vertical-menu-item">TWO</li> <li class="vertical-menu-item">THREE</li> <li class="vertical-menu-item">FOUR</li> <li class="vertical-menu-item">FIVE</li> </ul> </nav> <section> <div class="container"> <div class="default enabled"> <H1>ITEM BY DEFAULT</H1> </div> <div class="disabled"> <H1>ITEM BY DISABLED 1</H1> </div> <div class="disabled"> <H1>ITEM BY DISABLED 2</H1> </div> <div class="disabled"> <H1>ITEM BY DISABLED 3</H1> </div> <div class="disabled"> <H1>ITEM BY DISABLED 4</H1> </div> </div> </section>
</body> <script src="js/index.js"></script>
</body>
</html>

Vertical Accordeon Menu - Script Codes CSS Codes

* { padding: 0; margin: 0; font: 20px/14px Verdana;
}
nav { width: 20%; height: 100vh; background: #071D49; color: #FFF; display: inline-block; float: left;
}
.vertical-menu-item { height: calc(100%/5); padding: 50px; border-top: 1px solid #FFF;
}
.vertical-menu-item:first-child { border-top: 0;
}
.vertical-menu-item::after { position: absolute; left: 16%; content: '>';
}
.vertical-menu-item:hover { animation: navAnimation .5s; animation-fill-mode: forwards;
}
.vertical-menu-item:hover::after { animation: arrowAnimation .5s; animation-fill-mode: forwards;
}
section { height: 100vh; width: 80%; background: #EFF0F2; float: right;
}
.container { margin: 50px;
}
.default,
.enabled { animation: sectionAnimation .5s; animation-fill-mode: forwards;
}
.disabled { opacity: 0;
}
H1 { font-size: 36px;
} /* ANIMATIONS */
@keyframes navAnimation { from { background: #071D49; color: #FFF; } to { background: #FFC72C; color: #071D49; }
}
@keyframes arrowAnimation { from { left: 16%; } to { left: 17%; }
}
@keyframes sectionAnimationIn { from { opacity: 0; } to { opacity: 1; }
}

Vertical Accordeon Menu - Script Codes JS Codes

const handleClick = (e) => { e.preventDefault(); const active = document.querySelector('.enabled'); if(active){ active.classList.remove('enabled'); active.classList.add('disabled'); } e.currentTarget.classList.add('enabled');
}
Vertical Accordeon Menu - Script Codes
Vertical Accordeon Menu - Script Codes
Home Page Home
Developer Kévin Joffard
Username kejoff
Uploaded October 11, 2022
Rating 3
Size 2,226 Kb
Views 14,168
Do you need developer help for Vertical Accordeon Menu?

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!

Kévin Joffard (kejoff) Script Codes
Create amazing Facebook ads with AI!

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!