Jump to content

Markdown FAQs different section

Recommended Posts

  • Replies 3
  • Views 260
  • Created
  • Last Reply

Top Posters In This Topic

Popular Days

Top Posters In This Topic

Posted Images

It depends on the way you've coded it. You could use the built in accordion block instead, and have one for each category? Would that work?

Please like and upvote if my comments were helpful to you. Cheers!

Zygmunt Spray
Squarespace Website Designer
Contact me: 
https://squarefortytwo.com 

  Did I help? Buy me a coffee?

🔌 Ghost Squarespace Plugins (Referral link)
📈 SEO Space (Referral link)
 SquareWebsites Plugins (Referral link)
 🔲 SQSP Themes (Referral link) 
Spark Plugin (Referral link) 

Link to comment

Hi @Ziggy that's what I was thinking too, but that actually doesn't work because then there is a big gap between each accordion when they are not open. 
This is the code I used:


<script>
$(document).ready(function(){
$('.markdown-block .sqs-block-content h4').addClass('ui-closed').css('cursor','pointer');
$(".markdown-block .sqs-block-content h4").nextUntil("h4").slideToggle();
$(".markdown-block .sqs-block-content h4").click(function() {

$(this).nextUntil("h4").slideToggle();
$(this).toggleClass('ui-closed ui-open');
});
});
</script>

 

As in the attached picture, I thought it could work when I write the category without the #### but that doesn't work and the category get's hidden together with the answers.

 

Thank you!!

image.png

Link to comment
13 minutes ago, lucylou12 said:

.nextUntil("h4")

This is the problem, it contains everything from one H4 until the next H4. It's not been designed to have other titles in between, and I'm afraid I don't have an easy solution to change this. The only thing you could do is add the category as another H4 without anything after it, and then maybe make them bold? If you made them bold and italic you may be able to use that to target the category H4s.

Please like and upvote if my comments were helpful to you. Cheers!

Zygmunt Spray
Squarespace Website Designer
Contact me: 
https://squarefortytwo.com 

  Did I help? Buy me a coffee?

🔌 Ghost Squarespace Plugins (Referral link)
📈 SEO Space (Referral link)
 SquareWebsites Plugins (Referral link)
 🔲 SQSP Themes (Referral link) 
Spark Plugin (Referral link) 

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.