Accordion w. icons, 0.01
How do I make an accordion w. icons, 0.01?
What is a accordion w. icons, 0.01? How do you make a accordion w. icons, 0.01? This script and codes were developed by Daniel on 05 October 2022, Wednesday.
Accordion w. icons, 0.01 - Script Codes HTML Codes
<!DOCTYPE html>
<html >
<head> <meta charset="UTF-8"> <title>Accordion w. icons, 0.01</title> <link rel="stylesheet" href="css/style.css">
</head>
<body> <button class="accordion">Section 1</button>
<div class="panel"> <p>Lorem ipsum...</p>
</div>
<button class="accordion">Section 2</button>
<div class="panel"> <p>Lorem ipsum...</p>
</div>
<button class="accordion">Section 3</button>
<div class="panel"> <p>Lorem ipsum...</p>
</div> <script src="js/index.js"></script>
</body>
</html>
Accordion w. icons, 0.01 - Script Codes CSS Codes
body{ font-family:"helvetica neue", helvetia, arial, sans-serif; font-size:16px!important; font-weight:300;
}
button { font-size:16px; font-weight:400;
}/* Style the buttons that are used to open and close the accordion panel */
button.accordion { background-color: #eee; color: #444; cursor: pointer; padding: 18px; width: 100%; text-align: left; border: none; outline: none; transition: 0.4s; margin-bottom:5px;
}
/* Add a background color to the button if it is clicked on (add the .active class with JS), and when you move the mouse over it (hover) */
button.accordion.active, button.accordion:hover { background-color: #ddd;
}
/* Style the accordion panel. Note: hidden by default */
div.panel { padding: 0 18px; background-color: white; display: none;
}
/* The "show" class is added to the accordion panel when the user clicks on one of the buttons. This will show the panel content */
div.panel.show { display: block;
}
div.panel { padding: 0 18px; background-color: white; max-height: 0; overflow: hidden; transition: 0.6s ease-in-out; opacity: 0;
}
div.panel.show { opacity: 1; max-height: 500px; /* Whatever you like, as long as its more than the height of the content (on all screen sizes) */
}
button.accordion:after { content: '\02795'; /* Unicode character for "plus" sign (+) */ font-size: 14px; color: #777; float: LEFT; margin-left: 5px; margin-right: 15px;
}
button.accordion.active:after { content: "\2796"; /* Unicode character for "minus" sign (-) */
}
Accordion w. icons, 0.01 - Script Codes JS Codes
/* Toggle between adding and removing the "active" and "show" classes when the user clicks on one of the "Section" buttons. The "active" class is used to add a background color to the current button when its belonging panel is open. The "show" class is used to open the specific accordion panel */
var acc = document.getElementsByClassName("accordion");
var i;
for (i = 0; i < acc.length; i++) { acc[i].onclick = function(){ this.classList.toggle("active"); this.nextElementSibling.classList.toggle("show"); }
}
Developer | Daniel |
Username | deeman |
Uploaded | October 05, 2022 |
Rating | 3 |
Size | 2,497 Kb |
Views | 22,264 |
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 |
Top Header w. shadowed bottom | 1,578 Kb |
Box v0.1 | 2,187 Kb |
Subleveled Menu - Responsive and simple | 4,471 Kb |
Imagelinking | 1,412 Kb |
Sitemap for footer | 2,271 Kb |
Column Columns | 1,649 Kb |
The Awesome Responsive Form | 2,377 Kb |
Dropdown Menu | 2,905 Kb |
RWD Table v1.0 | 2,187 Kb |
Gridwork | 2,628 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 |
JQuery Validate checkbox group | Lunaman | 2,466 Kb |
A Pen by Jason Kinney | Jason-kinney | 1,980 Kb |
Fading Navigation Bar | J-w-v | 2,805 Kb |
Simple CSS loader. | Cabrera | 2,574 Kb |
Mobile first social buttons with no iframe | Alistairtweedie | 3,158 Kb |
Fixed with using Calc | Tomleo | 2,542 Kb |
Simple star rating using js and data-uri | TheEnd | 5,795 Kb |
Box-sizing | Elad2412 | 1,572 Kb |
Materializecss input form | Jasonchan | 1,443 Kb |
Simple yet functional | Matheusxaviersi | 2,025 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!