toggle
Page: Product Pages (Optimized for Conversions)


Snippet Code
<link rel="stylesheet" href="https://cdnjs.cloudflare.com/ajax/libs/font-awesome/7.0.1/css/all.min.css"
integrity="sha512-2SwdPD6INVrV/lHTZbO2nodKhrnDdJK9/kg2XD1r9uGqPo1cUbujc+IYdlYdEErWNu69gVcYgdxlmVmzTWnetw=="
crossorigin="anonymous" referrerpolicy="no-referrer" />
<style>
.custom-accordion1 {
width: 100%;
max-width: 900px;
margin: 0 auto;
font-family: Arial, sans-serif;
}
.accordion-item1 {
width: 100%;
margin-bottom: 10px;
}
.accordion-header1 {
width: 100%;
background: none;
border: none;
font-size: 18px;
padding: 15px 0;
font-weight: 500;
cursor: pointer;
display: flex;
justify-content: space-between;
align-items: center;
color: black;
border-bottom: 1px solid #cccccc;
}
.accordion-header1:hover {
background-color: #ffffff;
color: black;
border-color: #cccccc;
}
.acc-icon1 {
font-size: 18px;
transition: 0.3s ease;
}
.accordion-header1.active .acc-icon1 {
transform: rotate(180deg);
}
/* hr {
border: 0;
border-bottom: 1px solid #ddd;
} */
.accordion-content1 {
padding: 10px 0 15px 0;
display: none;
animation: fadeSlide 0.3s ease-in-out;
color: #333333;
}
.accordion-content1 ul {
padding-left: 20px;
}
.accordion-content1 li {
margin-bottom: 8px;
font-size: 15px;
line-height: 1.6;
}
.accordion-content1 a {
font-size: 14px;
text-decoration: underline;
}
/* Animation */
@keyframes fadeSlide {
from {
opacity: 0;
transform: translateY(-5px);
}
to {
opacity: 1;
transform: translateY(0px);
}
}
/* Responsive */
@media (max-width: 600px) {
.accordion-header1 {
font-size: 16px;
}
.accordion-content1 {
font-size: 14px;
}
}
</style>
<div class="custom-accordion1">
<!-- Accordion Item 1 -->
<div class="accordion-item1">
<button class="accordion-header1">
<span>Product Details</span>
<span class="acc-icon1">⌄</span>
</button>
<div class="accordion-content1">
<p>{{ product.description }}</p>
</div>
</div>
<!-- Accordion Item 2 -->
<div class="accordion-item1">
<button class="accordion-header1">
<span>Shipping & Returns</span>
<span class="acc-icon1">⌃</span>
</button>
<div class="accordion-content1" style="display:block;">
<p><i class="fa-solid fa-check"></i> Free Shipping</p>
<p><i class="fa-solid fa-check"></i>
Returnable within 2 days of delivery (3 days for Diamond tier members).
Custom-made orders are not returnable. Product's original tags, if attached,
must be intact for a successful return. If the original tags are missing,
the store may decline the return request.
<br>
<a href="#">More Details</a>
</p>
</div>
</div>
</div>
<script>
document.querySelectorAll(".accordion-header1").forEach((acc) => {
acc.addEventListener("click", function () {
const content = this.nextElementSibling;
// toggle open/close
if (content.style.display === "block") {
content.style.display = "none";
this.classList.remove("active");
} else {
// Close all others
document.querySelectorAll(".accordion-content1").forEach((c) => c.style.display = "none");
document.querySelectorAll(".accordion-header1").forEach((h) => h.classList.remove("active"));
content.style.display = "block";
this.classList.add("active");
}
});
});
</script>