Jump to content

Markup Not Collapsing Despite Adding the code recommended in other forum Posts

Go to solution Solved by paul2009,

Recommended Posts

Site URL: https://greenmountainssolar.com/

I have a markdown block which wasn't collapsing until I researched this forum and found a new code to use. Using the recommended code, the clock does collapse/expand once., but only immediately after I edit and save the respective page. It then reverts back to keeping the markdown in the expanded position. The code block is on each page, not the header. This is the code I copied in:

<script src="https://cdn.jsdelivr.net/npm/jquery@3.2.1/dist/jquery.min.js"></script>
<script>
     $(document).ready(function(){
    $('.markdown-block .sqs-block-content h3').css('cursor','pointer');
    $(".markdown-block .sqs-block-content h3").nextUntil("h3").slideToggle();
    $(".markdown-block .sqs-block-content h3").click(function() {$(this).nextUntil("h3").slideToggle();});
    });
</script>

Web capture_11-2-2022_134645_liam-madden-7pl8.squarespace.com.jpeg

Link to comment
  • Replies 4
  • Views 430
  • Created
  • Last Reply

Top Posters In This Topic

Did you know there's a built in Accordion Block that doesn't require code?

About me: I'm Paul. A SQSP User for 18 yrs, I joined Circle when it launched in 2016 and have been a Circle Leader since 2017. I value honesty, transparency, diversity and good design ♥.
Work: Founder of SF.DIGITAL, providing expertise and extensions to supercharge your Squarespace website. 
Content: Views and opinions are my own. Links in my posts may refer to my own SF.DIGITAL products or may be affiliate links.
Forum advice is free. You can thank me by clicking one of the feedback emojis below. Coffee fuels my work.

Book paid help with a Squarespace Domain

Link to comment

Hi Paul, Yes I initially tried the accordian and found it less elegant. I find the accordian is very appropriate for short FAQs because closing the question you're on is simple. But for longer form information, the accordian will disorient the reader by going to the bottom of the text and forces them to scroll back up to close it.

 

Link to comment
  • Solution
21 minutes ago, LiamMadden said:

Using the recommended code, the clock does collapse/expand once., but only immediately after I edit and save the respective page.

Disable Ajax Page Loading in Site Styles🙂

About me: I'm Paul. A SQSP User for 18 yrs, I joined Circle when it launched in 2016 and have been a Circle Leader since 2017. I value honesty, transparency, diversity and good design ♥.
Work: Founder of SF.DIGITAL, providing expertise and extensions to supercharge your Squarespace website. 
Content: Views and opinions are my own. Links in my posts may refer to my own SF.DIGITAL products or may be affiliate links.
Forum advice is free. You can thank me by clicking one of the feedback emojis below. Coffee fuels my work.

Book paid help with a Squarespace Domain

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.