VIDASBC Posted October 21, 2023 Posted October 21, 2023 Can you help me setup up my mardkdown dropdown H2 to open one at a time, and close the previous H2 heading when opening a new H2 heading? Is it possible to do through CSS codes or need to modify HTML code: my current header injection code in Squarespace webpage is: <script> $(document).ready(function(){ $('.markdown-block .sqs-block-content h2').css('cursor','pointer'); $(".markdown-block .sqs-block-content h2").nextUntil("h2").slideToggle(); $(".markdown-block .sqs-block-content h2").click(function() {$(this).nextUntil("h2").slideToggle();}); }); </script> What should be changed in this code to make this change?
Vigasan Posted October 21, 2023 Posted October 21, 2023 Hey, you can try the code from here: https://www.adlyticmarketing.com/blog/squarespace-creating-an-accordion-style-faq-section Also, Squarespace has an accordion block now, so see if that'll suit your needs as well. If an answer I provide helps you, please mark it as the answer so others can easily access it as well. I'm a Squarespace Authorized Trainer, Squarespace Expert, and Circle Member and I've been helping my clients as well as those here in the forum and in various Squarespace groups with custom coding and support for Squarespace websites. I would love to help you in any way I can. Squarespace Plugins | Book Live Help | Squarespace Video Tutorials | Buy Me a Coffee
Recommended Posts
Create an account or sign in to comment
You need to be a member in order to leave a comment