Jump to content

Link to an open FAQs accordion answer

Recommended Posts

Posted

Site URL: https://icosahedron-flounder-e9sx.squarespace.com/i-am-new

Currently I have a button which links to a Q&A expandable accordion here,  approx 2/3rds down the page "What is a dependent?".

I would like to have the first answer of the accordion open or expanded as you arrive to the link, instead of the current state which is closed?

Any thoughts?

THANKS!

Site password: 1234What is a dependent?What is a dependent?What is a dependent?

  • Replies 1
  • Views 719
  • Created
  • Last Reply
Posted
On 4/17/2021 at 12:28 AM, David_Ledger said:

Site URL: https://icosahedron-flounder-e9sx.squarespace.com/i-am-new

Currently I have a button which links to a Q&A expandable accordion here,  approx 2/3rds down the page "What is a dependent?".

I would like to have the first answer of the accordion open or expanded as you arrive to the link, instead of the current state which is closed?

Any thoughts?

THANKS!

Site password: 1234What is a dependent?What is a dependent?What is a dependent?

Modify your code snippet in the header injection and remove the line that toggle the content on page load

$(document).ready(function(){
  $('.markdown-block .sqs-block-content h4').addClass('ui-closed').css('cursor','pointer');
  //$(".markdown-block .sqs-block-content h4").nextUntil("h4").slideToggle();
  $(".markdown-block .sqs-block-content h4").click(function() {
    $(this).nextUntil("h4").slideToggle();
    $(this).toggleClass('ui-closed ui-open');
  });
});

image.thumb.png.f6b9960d8c9a4cd936166b7a85086996.png

BeyondSpace - Squarespace Website Developer

🖼️ Lightbox Studio (Enable Pinch/Zoom on lightbox - PDF Lightbox popup - ...) </>  🗓️ Delivery Date Picker (Date picker form field)
Gallery block 7.1 workaround </> No-code customisations for Squarespace

Archived

This topic is now archived and is closed to further replies.

×
×
  • 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.