charlineca Posted June 7, 2021 Share Posted June 7, 2021 Hi, I am trying to add a dropdown using the markdown option on a specific blog post (to display Sources). I have followed the steps here: https://fallonmade.com/blog/accordion-dropdown-squarespace-css but I don't know where to put the page header code in so the dropdown actually works? I tried the blog advanced settings and also tried uploading as code block in the blog post but it doesn't seem to be working. Link to comment
tuanphan Posted June 7, 2021 Share Posted June 7, 2021 Step1 + 2. Try this code, add to Page Header <script src="https://ajax.googleapis.com/ajax/libs/jquery/3.5.1/jquery.min.js"></script> <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> then continue with step 3,4.. You can also consider this accordion plugin. Less code, easy to install/customize Email me if you have need any help (free, of course.). Answer within 24 hours. Or send to forum message How to: Setup Password & Share url - Insert Custom CSS - Page Header - Upload Custom Font - Upload File - Find Block ID - Contact Customer Care Link to comment
charlineca Posted June 7, 2021 Author Share Posted June 7, 2021 1 hour ago, tuanphan said: Step1 + 2. Try this code, add to Page Header <script src="https://ajax.googleapis.com/ajax/libs/jquery/3.5.1/jquery.min.js"></script> <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> then continue with step 3,4.. You can also consider this accordion plugin. Less code, easy to install/customize To which page header? I am working with blog posts, they don't have page header CSS section.. Link to comment
tuanphan Posted June 8, 2021 Share Posted June 8, 2021 On 6/7/2021 at 8:44 PM, charlineca said: To which page header? I am working with blog posts, they don't have page header CSS section.. Blog Page Header Email me if you have need any help (free, of course.). Answer within 24 hours. Or send to forum message How to: Setup Password & Share url - Insert Custom CSS - Page Header - Upload Custom Font - Upload File - Find Block ID - Contact Customer Care 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