LiamMadden Posted February 11, 2022 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>
paul2009 Posted February 11, 2022 Posted February 11, 2022 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.
LiamMadden Posted February 11, 2022 Author 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.
Solution paul2009 Posted February 11, 2022 Solution 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. 🙂 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.
LiamMadden Posted February 12, 2022 Author 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
Recommended Posts
Create an account or sign in to comment
You need to be a member in order to leave a comment