Jump to content

How can I change the accordion section so that all items are automatically open when the page is loaded?

Recommended Posts

  • Replies 5
  • Views 940
  • Created
  • Last Reply

Top Posters In This Topic

On 4/5/2024 at 3:49 PM, Nomis said:

@tuanphan Yes, exactly, I want all of them to be open simultaneously but also manually closable. Is that possible?

 

Use this code to Website > Website Tools > Code Injection > Footer

<script src="https://ajax.googleapis.com/ajax/libs/jquery/3.7.0/jquery.min.js"></script>
<script>
  jQuery(document).ready(function($) {
if ($(window).width() > 992) {
$('.fe-block-5b8b9a8d9e014184ea1a li').attr('data-is-open','true');
$('.fe-block-5b8b9a8d9e014184ea1a .accordion-item__dropdown').addClass('accordion-item__dropdown--open');
}
});
</script>

 

Email me if you have need any help (free, of course.). Answer within 24 hours. 
Or send to forum message

Contact Customer Care - Learn CSS - Buy me a coffee (thank you!)

Link to comment

Create an account or sign in to comment

You need to be a member in order to leave a comment

×
×
  • Create New...

Squarespace Webinars

Free online sessions where you’ll learn the basics and refine your Squarespace skills.

Hire a Designer

Stand out online with the help of an experienced designer or developer.