Jump to content
Search In
  • More options...
Find results that contain...
Find results in...
Advanced Search
  • 0

Accordion/toggle style only on page refresh


soundslikezeezy
Go to solution Solved by brandon,

Question

Hello! I have been googling my heart out trying to find a solution.  I have the Avenue template and have some content for visitors to toggle and I used markdown

and in the page header code injection i have: 

<script type="text/javascript" src="//ajax.googleapis.com/ajax/libs/jquery/1/jquery.min.js"></script>
<script>
    $(document).ready(function(){
    $('.markdown-block .sqs-block-content h3').addClass('ui-closed').css('cursor','pointer');
    $(".markdown-block .sqs-block-content h3").nextUntil("h3").slideToggle();
    $(".markdown-block .sqs-block-content h3").click(function() {
      
      $(this).nextUntil("h3").slideToggle();
      $(this).toggleClass('ui-closed ui-open');
      });
    });
    </script>

It works when I click on the refresh button but not if I go to the page itself from another tab. I have to hit refresh in order for it the content to be hidden. It does the same on mobile. What am I missing? Do you need any other info from me? The page in question: https://www.brightsideup.org/find-child-care

Thank you all in advance. 

Link to post
  • Answers 2
  • Created
  • Last Reply

Top Posters For This Question

Popular Days

Top Posters For This Question

Popular Posts

Hi there. The issue has to do with AJAX loading. You can disable it, or you can edit your code to take AJAX loading into account. I hope this helps. -Brandon

2 answers to this question

Recommended Posts

Create an account or sign in to comment

You need to be a member in order to leave a comment


×
×
  • Create New...