Shopify themes, liquid, logos, and UX
Is there a way to adjust the 'collapsible row' element so that the first of the collapsible rows is open when the product page is clicked on? So you don't have to click on it to open it, the top collapsible row just opens automatically? Using the Origin theme.
Solved! Go to the solution
This is an accepted solution.
Hi @IronWisdom
Hi
You can use this javascript
Just Follow these steps:
</body>
<script src="https://cdnjs.cloudflare.com/ajax/libs/jquery/3.7.1/jquery.min.js"></script>
<script>
jQuery(document).ready(function() {
// Select the first <details> child of .product__accordion
const firstDetail = jQuery('.product__accordion details:first');
if (firstDetail.length) {
// Add the 'open' attribute to the first <details> element
firstDetail.attr('open', '');
// Add the 'aria-expanded' attribute to the <summary> inside the first <details>
firstDetail.find('summary').attr('aria-expanded', 'true');
}
});
</script>
-If this solution helps you, kindly LIKE THIS REPLY and MARK AS A SOLUTION OR
-If you need an expert Shopify developer for customization and development, feel free to contact me.
Email: Mehran.ali5300@gmail.com
WhatsApp: +92 343 0211536
Hi @IronWisdom
Can you please share you Store URL and Password if it password protected
-If this solution helps you, kindly LIKE THIS REPLY and MARK AS A SOLUTION OR
-If you need an expert Shopify developer for customization and development, feel free to contact me.
Email: Mehran.ali5300@gmail.com
WhatsApp: +92 343 0211536
This is an accepted solution.
Hi @IronWisdom
Hi
You can use this javascript
Just Follow these steps:
</body>
<script src="https://cdnjs.cloudflare.com/ajax/libs/jquery/3.7.1/jquery.min.js"></script>
<script>
jQuery(document).ready(function() {
// Select the first <details> child of .product__accordion
const firstDetail = jQuery('.product__accordion details:first');
if (firstDetail.length) {
// Add the 'open' attribute to the first <details> element
firstDetail.attr('open', '');
// Add the 'aria-expanded' attribute to the <summary> inside the first <details>
firstDetail.find('summary').attr('aria-expanded', 'true');
}
});
</script>
-If this solution helps you, kindly LIKE THIS REPLY and MARK AS A SOLUTION OR
-If you need an expert Shopify developer for customization and development, feel free to contact me.
Email: Mehran.ali5300@gmail.com
WhatsApp: +92 343 0211536
I tired the code but it didnt work. I also couldn't locate the </body> in the theme.liquid code after searching for it, is there somewhere else i can place it? I just threw it at the very end of the code right before the '</style>' at the end of the code.
Okay in that case can you please share the collaboration code so I can check that and add that code
-If this solution helps you, kindly LIKE THIS REPLY and MARK AS A SOLUTION OR
-If you need an expert Shopify developer for customization and development, feel free to contact me.
Email: Mehran.ali5300@gmail.com
WhatsApp: +92 343 0211536
Thank you so much! Save me lot of time!
June brought summer energy to our community. Members jumped in with solutions, clicked ...
By JasonH Jun 5, 2025Learn how to build powerful custom workflows in Shopify Flow with expert guidance from ...
By Jacqui May 7, 2025Did You Know? May is named after Maia, the Roman goddess of growth and flourishing! ...
By JasonH May 2, 2025