Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Toggle-option for FAQ QNAs added #2565

Merged
merged 2 commits into from
Nov 2, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
68 changes: 68 additions & 0 deletions demo.html
Original file line number Diff line number Diff line change
@@ -0,0 +1,68 @@
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>FAQ Accordion</title>
<style>
.accordion-button {
display: flex;
justify-content: space-between;
width: 100%;
cursor: pointer;
background-color: #f7f7f7;
border: 1px solid #ccc;
padding: 10px;
border-radius: 5px;
margin-bottom: 5px;
transition: background-color 0.3s;
}

.accordion-button:hover {
background-color: #e2e2e2;
}

.accordion-body {
padding: 10px;
border: 1px solid #ccc;
border-radius: 5px;
margin-top: 5px;
display: none; /* Initially hidden */
}

.show {
display: block; /* Display when expanded */
}

.accordion-button::after {
content: '▼'; /* Down arrow */
margin-left: auto; /* Align to the right */
transition: transform 0.3s;
}

.accordion-button.collapsed::after {
transform: rotate(-90deg); /* Rotate arrow when collapsed */
}
</style>
</head>
<body>
<div class="container mt-5">
<div class="accordion" id="faqAccordion">
<div class="accordion-item">
<h2 class="accordion-header" id="headingFive">
<button class="accordion-button collapsed" type="button" aria-expanded="false" aria-controls="collapseFive">
Is Finveda free to use?
</button>
</h2>
<div id="collapseFive" class="accordion-collapse">
<div class="accordion-body">
Yes, Finveda is completely free to use for all users.
</div>
</div>
</div>
</div>
</div>

<script src="final.js"></script> <!-- Link to external JS file -->
</body>
</html>
Loading
Loading