Shopify themes, liquid, logos, and UX
I'm looking to make the collapsible row in the (product information) page close after someone opens up another one for desktop and mobile on dawn theme
Solved! Go to the solution
This is an accepted solution.
Hello @undercoverfresh
Please follow the steps below after logging into the Shopify admin:
<script>
window.addEventListener("load", function () {
document.querySelectorAll("details").forEach((details) => {
details.addEventListener("click", function () {
if (this.open) {
document.querySelectorAll("details").forEach((other) => {
if (other !== this) {
other.removeAttribute("open");
}
});
}
});
details.addEventListener("toggle", function () {
if (this.open) {
document.querySelectorAll("details").forEach((other) => {
if (other !== this) {
other.removeAttribute("open");
}
});
}
});
});
});
</script>
Please hit Like and Mark it as a Solution if you find our reply helpful.
Thank You,
WebDesk Solution Support Team
Get a Free Quote | Email | Shopify Partner | Shopify Development Agency | Call: 877.536.3789
Canada: 150 King St W. STE 200, Toronto, ON M5H 1J9
| USA: 98 Cutter Mill Rd. STE 466, Great Neck, NY 11021
This is an accepted solution.
Hello @undercoverfresh
Please follow the steps below after logging into the Shopify admin:
<script>
window.addEventListener("load", function () {
document.querySelectorAll("details").forEach((details) => {
details.addEventListener("click", function () {
if (this.open) {
document.querySelectorAll("details").forEach((other) => {
if (other !== this) {
other.removeAttribute("open");
}
});
}
});
details.addEventListener("toggle", function () {
if (this.open) {
document.querySelectorAll("details").forEach((other) => {
if (other !== this) {
other.removeAttribute("open");
}
});
}
});
});
});
</script>
Please hit Like and Mark it as a Solution if you find our reply helpful.
Thank You,
WebDesk Solution Support Team
Get a Free Quote | Email | Shopify Partner | Shopify Development Agency | Call: 877.536.3789
Canada: 150 King St W. STE 200, Toronto, ON M5H 1J9
| USA: 98 Cutter Mill Rd. STE 466, Great Neck, NY 11021
In Canada, payment processors, like those that provide payment processing services t...
By Jacqui Mar 14, 2025Unlock the potential of marketing on your business growth with Shopify Academy's late...
By Shopify Mar 12, 2025Learn how to increase conversion rates in every stage of the customer journey by enroll...
By Shopify Mar 5, 2025