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
Hey Community! As we jump into 2025, we want to give a big shout-out to all of you wh...
By JasonH Jan 7, 2025Hey Community! As the holiday season unfolds, we want to extend heartfelt thanks to a...
By JasonH Dec 6, 2024Dropshipping, a high-growth, $226 billion-dollar industry, remains a highly dynamic bus...
By JasonH Nov 27, 2024