Jump to content

pickupgoliath

Member
  • Posts

    1
  • Joined

  • Last visited

Everything posted by pickupgoliath

  1. Site URL: https://www.nanoesclab.com/publications I have a markdown containing a large amount of items. They are categorised by year, which each collapsible item labelled as a year. I have the following script in my page settings, which works fine. <script src="https://ajax.googleapis.com/ajax/libs/jquery/3.3.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();}); }); $(document).ready(function(){ $('.markdown-block .sqs-block-content h2').click(function() {$(this).toggleClass('plus-minus');}); }); </script> However, I'd like it to only have one year open at a time. So when a new year is clicked the previously open one will automatically close. Any ideas??
×
×
  • 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.