Jump to content

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

Go to solution Solved by paul2009,

Recommended Posts

Posted

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

  • Replies 4
  • Views 553
  • Created
  • Last Reply

Top Posters In This Topic

Posted

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

Me: I'm Paul, a SQSP user for >18 yrs & Circle Leader since 2017. I value honesty, transparency, diversity and good design ♥.
Work: Founder of SF.DIGITAL. We provide high quality original 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 completely free. You can thank me by selecting a feedback emoji. Buying a coffee is generous but optional.

Posted

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.

 

  • Solution
Posted
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🙂

Me: I'm Paul, a SQSP user for >18 yrs & Circle Leader since 2017. I value honesty, transparency, diversity and good design ♥.
Work: Founder of SF.DIGITAL. We provide high quality original 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 completely free. You can thank me by selecting a feedback emoji. Buying a coffee is generous but optional.

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.