Accordiant Dropdown

HTML - MARKDOWN

Paste the following sample text into the Markdown block’s edit panel. Edit the sample text with your own content, and replicate it to create more tabs in the accordion. Be careful to maintain the structure shown in the sample.

**+** Title line or FAQ?
--------------------------------------------------
Sed ut perspiciatis unde omnis iste natus error sit voluptatem accusantium doloremque laudantium, totam rem aperiam, eaque ipsa quae ab illo inventore veritatis et quasi architecto beatae vitae dicta sunt explicabo. Nemo enim ipsam voluptatem quia voluptas sit aspernatur aut odit aut fugit, sed quia consequuntur magni dolores eos qui ratione voluptatem sequi nesciunt. Neque porro quisquam est, qui dolorem ipsum quia dolor sit amet, consectetur, adipisci velit, sed quia non numquam eius modi tempora incidunt ut labore et dolore magnam aliquam quaerat voluptatem.</br>

**+** As many headings as required...
--------------------------------------------------
Enim ipsam voluptatem quia voluptas sit aspernatur aut odit aut fugit, sed quia consequuntur magni dolores eos qui ratione voluptatem sequi nesciunt. Neque porro quisquam est, qui dolorem ipsum quia dolor sit amet, consectetur, adipisci velit, sed quia non numquam eius modi tempora incidunt ut labore et dolore magnam aliquam quaerat voluptatem.</br>

CSS

@accent-color: #F65959;

.sqs-block-markdown {
  h2 {
    font-size: 28px;
    font-weight: 800;
    margin-top: 10px;
    strong {
      color: @accent-color;
      padding-right: 8px;
    }
  }
  p {
    border-top: solid 1px #ccc;
    padding-top: 15px;
  }
}

JS - Code Injection Footer

<script src="https://ajax.googleapis.com/ajax/libs/jquery/2.2.0/jquery.min.js"></script>
<script>

init();             //Start the code when the page loads

function init(){
    $('.sqs-block-markdown h2').nextUntil('.sqs-block-markdown h2').slideUp();      //Your code (wrapped in a function)
    $('.sqs-block-markdown h2').unbind().click(function(){
        $('.sqs-block-markdown h2').not(this).nextUntil('.sqs-block-markdown h2').slideUp(),
        $(this).nextUntil('.sqs-block-markdown h2').slideToggle();
    });
  $('.sqs-block-markdown h2').css('cursor','pointer');
}

document.addEventListener('pageChange', function(){             //When the change page event fires due to ajax
    init();                                                     //Call the code again
});

/*This stuff listens for an ajax page change*/
window.onload = watch;
function watch(){MutationObserver=window.MutationObserver||window.WebKitMutationObserver;var a=new MutationObserver(function(a){for(var b=0;b<a.length;b++){var c=a[b];if("attributes"===c.type){var d=new Event("pageChange");document.dispatchEvent(d)}}});a.observe(document.body,{attributes:!0,attributeFilter:["id"]})}
</script>