LiamMadden Posted February 11, 2022 Share Posted February 11, 2022 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> Link to comment
paul2009 Posted February 11, 2022 Share Posted February 11, 2022 Did you know there's a built in Accordion Block that doesn't require code? About: Squarespace Circle Leader since 2017. I value honesty, transparency, diversity and great design ♥.Work: Squarespace Developer and founder of SF Digital, building the features Squarespace didn't include™. Content: Links in my posts may refer to SF Digital products or may be affiliate links. Catch up on all the release notes and announcements 2023 [for Circle members only]. There's a public version here too!If I helped, you can thank me by clicking one of the emojis below. If you prefer, you can buy me a coffee.Improve your online store with our extensions. Link to comment
LiamMadden Posted February 11, 2022 Author Share Posted February 11, 2022 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 paul2009 Posted February 11, 2022 Solution Share Posted February 11, 2022 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: Squarespace Circle Leader since 2017. I value honesty, transparency, diversity and great design ♥.Work: Squarespace Developer and founder of SF Digital, building the features Squarespace didn't include™. Content: Links in my posts may refer to SF Digital products or may be affiliate links. Catch up on all the release notes and announcements 2023 [for Circle members only]. There's a public version here too!If I helped, you can thank me by clicking one of the emojis below. If you prefer, you can buy me a coffee.Improve your online store with our extensions. Link to comment
LiamMadden Posted February 12, 2022 Author Share Posted February 12, 2022 That did the trick. Thanks Paul, you make the world work! Beer on me next time you're in Vt! paul2009 1 Link to comment
Recommended Posts
Create an account or sign in to comment
You need to be a member in order to leave a comment