Jump to content

Markdown Accordions Broken after upgrading to 7.1

Recommended Posts

Hello!

I just upgraded from 7.0 Brine template to 7.1 and the accordions I built using Markdown blocks are broken. I know Squarespace now has an Accordion Block, but I don't want to rebuild them in the Accordion block because Markdown is easier and offers more flexibility for formatting. Here is the code I'm using for the Markdown in the Page Injection:

<script type="text/javascript" src="//ajax.googleapis.com/ajax/libs/jquery/1/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>

Here is a test page this is in use: www.kylelovestori.com/price-guide-test-page 

Under the "What Do You Get" heading, those are all supposed to be nested in an accordion. Any help would be greatly appreciated!

Link to comment
  • Replies 2
  • Views 1.1k
  • Created
  • Last Reply

Top Posters In This Topic

Update: I got this working on this page using the following code:


<script type="text/javascript" src="//ajax.googleapis.com/ajax/libs/jquery/1/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>

Next confounding question, the same exact code isn't working on this page: https://www.kylelovestori.com/zion-elopement-photographer (add #travel) to go right to the section that doesn't work.

If you click on the heading, it will make the animation of collapsing, but it won't stay collapsed.

Eventually, this page is going to be broken down into separate pages for each topic for better SEO performance, but I'd like this to work in the meantime! Any ideas why it works on one page but not the other?

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.